mirror of https://github.com/minio/minio.git
reduce timeouts between servers for faster disconnects (#10562)
This commit is contained in:
parent
3cac262dd1
commit
37a5d5d7a0
|
@ -23,6 +23,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/http"
|
"github.com/minio/minio/cmd/http"
|
||||||
xhttp "github.com/minio/minio/cmd/http"
|
xhttp "github.com/minio/minio/cmd/http"
|
||||||
|
@ -152,7 +153,7 @@ func newlockRESTClient(endpoint Endpoint) *lockRESTClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trFn := newInternodeHTTPTransport(tlsConfig, rest.DefaultRESTTimeout)
|
trFn := newInternodeHTTPTransport(tlsConfig, 10*time.Second)
|
||||||
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
|
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
|
||||||
restClient.HealthCheckFn = func() bool {
|
restClient.HealthCheckFn = func() bool {
|
||||||
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)
|
ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout)
|
||||||
|
|
|
@ -883,7 +883,7 @@ func newPeerRESTClient(peer *xnet.Host) *peerRESTClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trFn := newInternodeHTTPTransport(tlsConfig, rest.DefaultRESTTimeout)
|
trFn := newInternodeHTTPTransport(tlsConfig, 10*time.Second)
|
||||||
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
|
restClient := rest.NewClient(serverURL, trFn, newAuthToken)
|
||||||
|
|
||||||
// Construct a new health function.
|
// Construct a new health function.
|
||||||
|
|
|
@ -30,8 +30,8 @@ import (
|
||||||
xnet "github.com/minio/minio/pkg/net"
|
xnet "github.com/minio/minio/pkg/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultRESTTimeout - default RPC timeout is one minute.
|
// DefaultRESTTimeout - default RPC timeout is 15 seconds.
|
||||||
const DefaultRESTTimeout = 1 * time.Minute
|
const DefaultRESTTimeout = 15 * time.Second
|
||||||
|
|
||||||
const (
|
const (
|
||||||
offline = iota
|
offline = iota
|
||||||
|
|
|
@ -470,11 +470,10 @@ func newInternodeHTTPTransport(tlsConfig *tls.Config, dialTimeout time.Duration)
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
DialContext: xhttp.NewInternodeDialContext(dialTimeout),
|
DialContext: xhttp.NewInternodeDialContext(dialTimeout),
|
||||||
MaxIdleConnsPerHost: 16,
|
MaxIdleConnsPerHost: 16,
|
||||||
MaxIdleConns: 16,
|
IdleConnTimeout: 30 * time.Second,
|
||||||
IdleConnTimeout: 1 * time.Minute,
|
|
||||||
ResponseHeaderTimeout: 3 * time.Minute, // Set conservative timeouts for MinIO internode.
|
ResponseHeaderTimeout: 3 * time.Minute, // Set conservative timeouts for MinIO internode.
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 15 * time.Second,
|
||||||
ExpectContinueTimeout: 10 * time.Second,
|
ExpectContinueTimeout: 15 * time.Second,
|
||||||
TLSClientConfig: tlsConfig,
|
TLSClientConfig: tlsConfig,
|
||||||
// Go net/http automatically unzip if content-type is
|
// Go net/http automatically unzip if content-type is
|
||||||
// gzip disable this feature, as we are always interested
|
// gzip disable this feature, as we are always interested
|
||||||
|
|
Loading…
Reference in New Issue