mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
fix: network failure err check should ignore context canceled errors (#10567)
context canceled errors bubbling up from the network layer has the potential to be misconstrued as network errors, taking prematurely a server offline and triggering a health check routine avoid this potential occurrence.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package net
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -144,6 +145,9 @@ func IsNetworkOrHostDown(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
if errors.Is(err, context.Canceled) {
|
||||
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