mirror of
https://github.com/minio/minio.git
synced 2025-11-10 14:09:48 -05:00
fix: network shutdown was not handle properly (#10927)
fixes a regression introduced in #10859, due to the error returned by rest.Client being typed i.e *rest.NetworkError - IsNetworkHostDown function didn't work as expected to detect network issues. This in-turn aggravated the situations when nodes are disconnected leading to performance loss.
This commit is contained in:
@@ -147,12 +147,15 @@ func IsNetworkOrHostDown(err error, expectTimeouts bool) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return false
|
||||
}
|
||||
|
||||
if expectTimeouts && errors.Is(err, context.DeadlineExceeded) {
|
||||
return false
|
||||
}
|
||||
|
||||
// We need to figure if the error either a timeout
|
||||
// or a non-temporary error.
|
||||
e, ok := err.(net.Error)
|
||||
|
||||
Reference in New Issue
Block a user