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

@@ -44,8 +44,8 @@ func isNetworkError(err error) bool {
if err.Error() == errConnectionStale.Error() {
return true
}
if _, ok := err.(*rest.NetworkError); ok {
return true
if nerr, ok := err.(*rest.NetworkError); ok {
return isNetworkOrHostDown(nerr.Err)
}
return false
}