fix: converting 'server closed idle connection' to errDiskNotFound (#17330)

This commit is contained in:
Anis Eleuch 2023-06-01 23:40:28 +01:00 committed by GitHub
parent 54e544e03e
commit 931712dc46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,10 +46,14 @@ func isNetworkError(err error) bool {
if err == nil { if err == nil {
return false return false
} }
if nerr, ok := err.(*rest.NetworkError); ok { if nerr, ok := err.(*rest.NetworkError); ok {
return xnet.IsNetworkOrHostDown(nerr.Err, false) if down := xnet.IsNetworkOrHostDown(nerr.Err, false); down {
return true
}
} }
// More corner cases suitable for storage REST API
switch { switch {
// A peer node can be in shut down phase and proactively // A peer node can be in shut down phase and proactively
// return 503 server closed error,consider it as an offline node // return 503 server closed error,consider it as an offline node