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 {
return false
}
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 {
// A peer node can be in shut down phase and proactively
// return 503 server closed error,consider it as an offline node