We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 51d157e + dd5901a commit 66f189fCopy full SHA for 66f189f
sockets/sockets.go
@@ -27,6 +27,14 @@ var ErrProtocolNotAvailable = errors.New("protocol not available")
27
// make sure you do it _after_ any subsequent calls to ConfigureTransport is made against the same
28
// [http.Transport].
29
func ConfigureTransport(tr *http.Transport, proto, addr string) error {
30
+ if tr.MaxIdleConns == 0 {
31
+ // prevent long-lived processes from leaking connections
32
+ // due to idle connections not being released.
33
+ //
34
+ // TODO: see if we can also address this from the server side; see: https://github.com/moby/moby/issues/45539
35
+ tr.MaxIdleConns = 6
36
+ tr.IdleConnTimeout = 30 * time.Second
37
+ }
38
switch proto {
39
case "unix":
40
return configureUnixTransport(tr, proto, addr)
0 commit comments