fix(compute/metadata): set IdleConnTimeout for http.Client
This helps clean up idled connections held by the keep-alive. The default transport set this to 90 seconds but since we declare our own the default zero value means they are never closed out if they are under the threshold for connections to keep alive(2).
Fixes:
@@ -70,6 +70,7 @@ func newDefaultHTTPClient() *http.Client {
Timeout: 2 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
+ IdleConnTimeout: 60 * time.Second,
},
Timeout: 5 * time.Second,
}
