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:
Harshavardhana
2020-11-19 13:53:49 -08:00
committed by GitHub
parent 0f9e125cf3
commit f794fe79e3
4 changed files with 6 additions and 4 deletions

View File

@@ -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
}
}