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
+1
View File
@@ -91,6 +91,7 @@ func (s *NodeService) FetchCertFingerprint(ctx context.Context, n *model.Node) (
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // lgtm[go/disabled-certificate-check]
},
}
defer client.CloseIdleConnections()
resp, err := client.Do(req)
if err != nil {
return "", err