From f28dbbe5c5d07402605832d7fb4b2cb71e2c274a Mon Sep 17 00:00:00 2001 From: banjiaojuhao Date: Thu, 10 Mar 2022 11:40:39 +0800 Subject: [PATCH] [bugfix] filer: 1. Delete uploaded chunks when upload failed. 2. Report error when upload is interrupted by user. --- weed/server/filer_server_handlers_write_upload.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/server/filer_server_handlers_write_upload.go b/weed/server/filer_server_handlers_write_upload.go index 15a4bac33..6ee378819 100644 --- a/weed/server/filer_server_handlers_write_upload.go +++ b/weed/server/filer_server_handlers_write_upload.go @@ -79,6 +79,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque bufPool.Put(bytesBuffer) atomic.AddInt64(&bytesBufferCounter, -1) bytesBufferLimitCond.Signal() + uploadErr = err break } if chunkOffset == 0 && !isAppend { @@ -126,6 +127,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque wg.Wait() if uploadErr != nil { + fs.filer.DeleteChunks(fileChunks) return nil, md5Hash, 0, uploadErr, nil }