Do not assume all HTTP errors as Network errors (#7983)

In situations such as when client uploading data,
prematurely disconnects from server such as pressing
ctrl-c before uploading all the data. Under this
situation in distributed setup we prematurely
disconnect disks causing a reconnect loop. This has
an adverse affect we end up leaving a lot of files
in temporary location which ideally should have been
cleaned up when Put() prematurely fails.

This is also a regression which got introduced in #7610
This commit is contained in:
Harshavardhana
2019-07-29 14:48:18 -07:00
committed by kannappanr
parent 94c88890b8
commit 54eded2e6f
3 changed files with 17 additions and 27 deletions

View File

@@ -129,7 +129,7 @@ func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string)
// Entry path is empty, just delete it.
if len(entries) == 0 {
err = storage.DeleteFile(volume, path.Clean(entryPath))
err = storage.DeleteFile(volume, entryPath)
logger.LogIf(ctx, err)
return err
}