fix: proxies set keep-alive timeouts to be system dependent (#10199)

Split the DialContext's one for internode and another
for all other external communications especially
proxy forwarders, gateway transport etc.
This commit is contained in:
Harshavardhana
2020-08-04 14:55:53 -07:00
committed by GitHub
parent 019fe69a57
commit 0b8255529a
10 changed files with 94 additions and 24 deletions
+5 -1
View File
@@ -17,6 +17,7 @@
package cmd
import (
"context"
"crypto/tls"
"fmt"
"net/http"
@@ -212,7 +213,10 @@ func IsServerResolvable(endpoint Endpoint) error {
}
defer httpClient.CloseIdleConnections()
resp, err := httpClient.Do(req)
ctx, cancel := context.WithTimeout(GlobalContext, 5*time.Second)
defer cancel()
resp, err := httpClient.Do(req.WithContext(ctx))
if err != nil {
return err
}