diff --git a/cmd/http/dial_dnscache.go b/cmd/http/dial_dnscache.go index 34612d12c..c1f1edd4f 100644 --- a/cmd/http/dial_dnscache.go +++ b/cmd/http/dial_dnscache.go @@ -44,7 +44,9 @@ func DialContextWithDNSCache(cache *DNSCache, baseDialCtx DialContext) DialConte baseDialCtx = (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, - DualStack: true, + // If zero, Go defaults to '300ms', we will default to 100ms instead. + // https://tools.ietf.org/html/rfc6555 + FallbackDelay: 100 * time.Millisecond, }).DialContext } return func(ctx context.Context, network, host string) (net.Conn, error) { diff --git a/cmd/http/dial_linux.go b/cmd/http/dial_linux.go index c79a1dde4..dcdabb753 100644 --- a/cmd/http/dial_linux.go +++ b/cmd/http/dial_linux.go @@ -68,6 +68,9 @@ func NewInternodeDialContext(dialTimeout time.Duration) DialContext { return func(ctx context.Context, network, addr string) (net.Conn, error) { dialer := &net.Dialer{ Timeout: dialTimeout, + // If zero, Go defaults to '300ms', we will default to 100ms instead. + // https://tools.ietf.org/html/rfc6555 + FallbackDelay: 100 * time.Millisecond, Control: func(network, address string, c syscall.RawConn) error { return setInternalTCPParameters(c) }, @@ -81,6 +84,9 @@ func NewCustomDialContext(dialTimeout time.Duration) DialContext { return func(ctx context.Context, network, addr string) (net.Conn, error) { dialer := &net.Dialer{ Timeout: dialTimeout, + // If zero, Go defaults to '300ms', we will default to 100ms instead. + // https://tools.ietf.org/html/rfc6555 + FallbackDelay: 100 * time.Millisecond, Control: func(network, address string, c syscall.RawConn) error { return c.Control(func(fdPtr uintptr) { // got socket file descriptor to set parameters. diff --git a/cmd/local-locker.go b/cmd/local-locker.go index aa123c622..cd42f44df 100644 --- a/cmd/local-locker.go +++ b/cmd/local-locker.go @@ -258,7 +258,7 @@ func (l *localLocker) Expired(ctx context.Context, args dsync.LockArgs) (expired ep := globalRemoteEndpoints[args.Owner] if !ep.IsLocal { // check if the owner is online - return isServerResolvable(ep, 250*time.Millisecond) != nil, nil + return isServerResolvable(ep, 1*time.Second) != nil, nil } return false, nil } diff --git a/cmd/lock-rest-server.go b/cmd/lock-rest-server.go index 367589e6f..cb24bbd30 100644 --- a/cmd/lock-rest-server.go +++ b/cmd/lock-rest-server.go @@ -302,7 +302,7 @@ func lockMaintenance(ctx context.Context, interval time.Duration) error { for _, c := range lockers { go func(lrip lockRequesterInfo, c dsync.NetLocker) { defer wg.Done() - ctx, cancel := context.WithTimeout(GlobalContext, 3*time.Second) + ctx, cancel := context.WithTimeout(GlobalContext, 5*time.Second) // Call back to all participating servers, verify // if each of those servers think lock is still diff --git a/pkg/madmin/transport.go b/pkg/madmin/transport.go index ff9be7412..25e10dab6 100644 --- a/pkg/madmin/transport.go +++ b/pkg/madmin/transport.go @@ -30,8 +30,9 @@ var DefaultTransport = func(secure bool) http.RoundTripper { tr := &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ - Timeout: 5 * time.Second, - KeepAlive: 15 * time.Second, + Timeout: 5 * time.Second, + KeepAlive: 15 * time.Second, + FallbackDelay: 100 * time.Millisecond, }).DialContext, MaxIdleConns: 1024, MaxIdleConnsPerHost: 1024,