mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Don't mark remotes online when shutting down (#11368)
Shutting down will mark remotes online when the shutdown has started since the context is canceled. For example: ``` API: SYSTEM() Time: 16:21:31 CET 01/28/2021 DeploymentID: 313b0065-c5a1-4aa3-9233-07223e77a730 Error: Storage resources are insufficient for the write operation .minio.sys/tmp/ced455c4-3d27-4bdd-95fc-b4707a179b8a/fd934ef3-8fc8-4330-abc1-f039fbbb9700/part.1 (cmd.InsufficientWriteQuorum) 1: d:\minio\minio\cmd\data-usage.go:56:cmd.storeDataUsageInBackend() Exiting on signal: INTERRUPT Client http://127.0.0.1:9002/minio/lock/v5 online Client http://127.0.0.1:9002/minio/storage/data/distxl/s2/d3/v24 online Client http://127.0.0.1:9002/minio/storage/data/distxl/s2/d2/v24 online Client http://127.0.0.1:9002/minio/storage/data/distxl/s2/d1/v24 online Client http://127.0.0.1:9002/minio/peer/v12 online Client http://127.0.0.1:9002/minio/storage/data/distxl/s2/d4/v24 online ``` Use a fresh context for health checks.
This commit is contained in:
parent
567f7bdd05
commit
2680772d4b
@ -161,7 +161,7 @@ func newlockRESTClient(endpoint Endpoint) *lockRESTClient {
|
||||
healthClient := rest.NewClient(serverURL, globalInternodeTransport, newAuthToken)
|
||||
healthClient.ExpectTimeouts = true
|
||||
restClient.HealthCheckFn = func() bool {
|
||||
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout)
|
||||
defer cancel()
|
||||
respBody, err := healthClient.Call(ctx, lockRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
|
@ -881,7 +881,7 @@ func newPeerRESTClient(peer *xnet.Host) *peerRESTClient {
|
||||
|
||||
// Construct a new health function.
|
||||
restClient.HealthCheckFn = func() bool {
|
||||
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout)
|
||||
defer cancel()
|
||||
respBody, err := healthClient.Call(ctx, peerRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
|
@ -662,7 +662,7 @@ func newStorageRESTClient(endpoint Endpoint, healthcheck bool) *storageRESTClien
|
||||
healthClient := rest.NewClient(serverURL, globalInternodeTransport, newAuthToken)
|
||||
healthClient.ExpectTimeouts = true
|
||||
restClient.HealthCheckFn = func() bool {
|
||||
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout)
|
||||
defer cancel()
|
||||
respBody, err := healthClient.Call(ctx, storageRESTMethodHealth, nil, nil, -1)
|
||||
xhttp.DrainBody(respBody)
|
||||
|
Loading…
Reference in New Issue
Block a user