Skip to content

Commit af6ada9

Browse files
committed
client: fix leaking idle connections
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
1 parent bc3805a commit af6ada9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

client/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
"net/url"
4848
"path"
4949
"strings"
50+
"time"
5051

5152
"github.com/docker/docker/api"
5253
"github.com/docker/docker/api/types"
@@ -167,6 +168,9 @@ func defaultHTTPClient(host string) (*http.Client, error) {
167168
}
168169
transport := &http.Transport{}
169170
_ = sockets.ConfigureTransport(transport, hostURL.Scheme, hostURL.Host)
171+
transport.MaxIdleConns = 6
172+
transport.IdleConnTimeout = 30 * time.Second
173+
// transport.DisableKeepAlives = true
170174
return &http.Client{
171175
Transport: transport,
172176
CheckRedirect: CheckRedirect,

0 commit comments

Comments
 (0)