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{
Transport: NewHTTPTransport(),
Transport: globalHealthChkTransport,
Timeout: 10 * time.Second,
}

View file

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

View file

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

View file

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