mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
storage: Increase the timeout of storage REST requests (#7218)
This commit increases storage REST requests to 5 minutes, this includes the opening TCP connection, and sending/receiving data. This will reduce clients receiving errors when the server is under high load.
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
"net/url"
|
||||
"path"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"encoding/gob"
|
||||
"encoding/hex"
|
||||
@@ -38,6 +39,10 @@ import (
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
)
|
||||
|
||||
// The timeout of TCP connect and sending/receiving
|
||||
// data for all internode storage REST requests.
|
||||
const storageRESTTimeout = 5 * time.Minute
|
||||
|
||||
func isNetworkDisconnectError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
@@ -376,6 +381,6 @@ func newStorageRESTClient(endpoint Endpoint) *storageRESTClient {
|
||||
}
|
||||
}
|
||||
|
||||
restClient := rest.NewClient(serverURL, tlsConfig, rest.DefaultRESTTimeout, newAuthToken)
|
||||
restClient := rest.NewClient(serverURL, tlsConfig, storageRESTTimeout, newAuthToken)
|
||||
return &storageRESTClient{endpoint: endpoint, restClient: restClient, connected: true}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user