From e105eec9c91afdd19e5245ddfadf2e2d2155eb6f Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Tue, 8 Nov 2016 10:03:43 -0800 Subject: [PATCH] Disable keep-alive for SSH tunnel health checks We don't reuse the http client. Disabling the keep-alive to properly close the connections. --- pkg/ssh/ssh.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/ssh/ssh.go b/pkg/ssh/ssh.go index f90afe263ce..a1d88b6e954 100644 --- a/pkg/ssh/ssh.go +++ b/pkg/ssh/ssh.go @@ -364,6 +364,9 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error { Dial: e.Tunnel.Dial, // TODO(cjcullen): Plumb real TLS options through. TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + // We don't reuse the clients, so disable the keep-alive to properly + // close the connection. + DisableKeepAlives: true, }) client := &http.Client{Transport: transport} resp, err := client.Get(l.healthCheckURL.String())