reuse transports for callhome and remote tgt validation (#18912)

This commit is contained in:
Poorna 2024-01-29 23:05:39 -08:00 committed by GitHub
parent 486e2e48ea
commit bcfd7fbbcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View File

@ -2337,7 +2337,7 @@ func getKubernetesInfo(dctx context.Context) madmin.KubernetesInfo {
} }
client := &http.Client{ client := &http.Client{
Transport: NewHTTPTransport(), Transport: globalHealthChkTransport,
Timeout: 10 * time.Second, Timeout: 10 * time.Second,
} }

View File

@ -179,7 +179,7 @@ func checkRemoteEndpoint(ctx context.Context, epURL *url.URL) error {
} }
client := &http.Client{ client := &http.Client{
Transport: NewHTTPTransport(), Transport: globalRemoteTargetTransport,
Timeout: 10 * time.Second, Timeout: 10 * time.Second,
} }

View File

@ -390,6 +390,8 @@ var (
globalRemoteTargetTransport http.RoundTripper globalRemoteTargetTransport http.RoundTripper
globalHealthChkTransport http.RoundTripper
globalDNSCache = &dnscache.Resolver{ globalDNSCache = &dnscache.Resolver{
Timeout: 5 * time.Second, Timeout: 5 * time.Second,
} }

View File

@ -339,7 +339,7 @@ func serverHandleCmdArgs(ctxt serverCtxt) {
globalProxyEndpoints = GetProxyEndpoints(globalEndpoints) globalProxyEndpoints = GetProxyEndpoints(globalEndpoints)
globalInternodeTransport = NewInternodeHTTPTransport(ctxt.MaxIdleConnsPerHost)() globalInternodeTransport = NewInternodeHTTPTransport(ctxt.MaxIdleConnsPerHost)()
globalRemoteTargetTransport = NewRemoteTargetHTTPTransport(false)() globalRemoteTargetTransport = NewRemoteTargetHTTPTransport(false)()
globalHealthChkTransport = NewHTTPTransport()
globalForwarder = handlers.NewForwarder(&handlers.Forwarder{ globalForwarder = handlers.NewForwarder(&handlers.Forwarder{
PassHost: true, PassHost: true,
RoundTripper: NewHTTPTransportWithTimeout(1 * time.Hour), RoundTripper: NewHTTPTransportWithTimeout(1 * time.Hour),