mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -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:
@@ -27,7 +27,6 @@ import (
|
||||
xhttp "github.com/minio/minio/cmd/http"
|
||||
"github.com/minio/minio/cmd/rest"
|
||||
"github.com/minio/minio/pkg/dsync"
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
)
|
||||
|
||||
// lockRESTClient is authenticable lock REST client
|
||||
@@ -161,7 +160,7 @@ func newlockRESTClient(endpoint Endpoint) *lockRESTClient {
|
||||
defer cancel()
|
||||
respBody, err := healthClient.Call(ctx, lockRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
return !xnet.IsNetworkOrHostDown(err, false)
|
||||
return !isNetworkError(err)
|
||||
}
|
||||
|
||||
return &lockRESTClient{endpoint: endpoint, restClient: restClient}
|
||||
|
||||
@@ -882,7 +882,7 @@ func newPeerRESTClient(peer *xnet.Host) *peerRESTClient {
|
||||
defer cancel()
|
||||
respBody, err := healthClient.Call(ctx, peerRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
return !xnet.IsNetworkOrHostDown(err, false)
|
||||
return !isNetworkError(err)
|
||||
}
|
||||
|
||||
return &peerRESTClient{host: peer, restClient: restClient}
|
||||
|
||||
@@ -626,7 +626,7 @@ func newStorageRESTClient(endpoint Endpoint, healthcheck bool) *storageRESTClien
|
||||
respBody, err := healthClient.Call(ctx, storageRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
cancel()
|
||||
return !xnet.IsNetworkOrHostDown(err, false) && toStorageErr(err) != errDiskNotFound
|
||||
return toStorageErr(err) != errDiskNotFound
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user