fix(net): stop per-request clients parking connections to remote hosts

The node certificate probe builds a transport for one request and dropped
it with the connection still parked, and the remote routing client kept
idle connections with no timeout; either stayed open for as long as the
remote side wanted. Close the probe's idle connections when it returns,
and turn keep-alive off for routing downloads, which are minutes apart.
The routing client dials only public hosts, so no loopback test reaches
it; TestFetchCertFingerprintLeavesNoIdleConnection covers the probe.
This commit is contained in:
MHSanaei
2026-10-31 08:32:58 +00:00
parent f1444bec3f
commit db20e491e6
3 changed files with 42 additions and 1 deletions
+3 -1
View File
@@ -486,7 +486,9 @@ func newRemoteRoutingHTTPClient() *http.Client {
ForceAttemptHTTP2: true,
TLSHandshakeTimeout: 4 * time.Second,
ResponseHeaderTimeout: 5 * time.Second,
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
// Downloads are minutes apart, and a parked connection lives as long as the host likes.
DisableKeepAlives: true,
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
}
return &http.Client{
Timeout: remoteRoutingHTTPTimeout,