Skip to content

Commit 2ed9486

Browse files
authored
Merge pull request #2358 from gauravkghildiyal/tcp-leaks
fix leaking TCP connections which leads to consistent conformance test failures
2 parents 4f8e572 + ddd0fd2 commit 2ed9486

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

conformance/utils/roundtripper/roundtripper.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ func (d *DefaultRoundTripper) CaptureRoundTrip(request Request) (*CapturedReques
119119

120120
transport := &http.Transport{
121121
DialContext: d.CustomDialContext,
122+
// We disable keep-alives so that we don't leak established TCP connections.
123+
// Leaking TCP connections is bad because we could eventually hit the
124+
// threshold of maximum number of open TCP connections to a specific
125+
// destination. Keep-alives are not presently utilized so disabling this has
126+
// no adverse affect.
127+
//
128+
// Ref. https://github.com/kubernetes-sigs/gateway-api/issues/2357
129+
DisableKeepAlives: true,
122130
}
123131
if request.Server != "" && len(request.CertPem) != 0 && len(request.KeyPem) != 0 {
124132
tlsConfig, err := tlsClientConfig(request.Server, request.CertPem, request.KeyPem)

0 commit comments

Comments
 (0)