make sure to release locks upon timeout (#10596)

fixes #10418
This commit is contained in:
Harshavardhana
2020-09-29 15:18:34 -07:00
committed by GitHub
parent fdf0ae9167
commit 1f9abbee4d
8 changed files with 34 additions and 31 deletions

View File

@@ -23,7 +23,6 @@ import (
"errors"
"io"
"net/url"
"time"
"github.com/minio/minio/cmd/http"
xhttp "github.com/minio/minio/cmd/http"
@@ -154,7 +153,7 @@ func newlockRESTClient(endpoint Endpoint) *lockRESTClient {
}
}
trFn := newInternodeHTTPTransport(tlsConfig, 10*time.Second)
trFn := newInternodeHTTPTransport(tlsConfig, rest.DefaultTimeout)
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
restClient.HealthCheckFn = func() bool {
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)