Skip to content

Commit

Permalink
Disable keep alives
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Potter authored and telday committed Oct 27, 2023
1 parent 3521aaa commit 2bc748f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/pkg/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func NewTransport(info TLSInfo, dialtimeoutd time.Duration) (*http.Transport, er
// value taken from http.DefaultTransport
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: cfg,
DisableKeepAlives: true,
}

dialer := &net.Dialer{
Expand All @@ -55,6 +56,7 @@ func NewTransport(info TLSInfo, dialtimeoutd time.Duration) (*http.Transport, er
DialContext: dialContext,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: cfg,
DisableKeepAlives: true,
// Cost of reopening connection on sockets is low, and they are mostly used in testing.
// Long living unix-transport connections were leading to 'leak' test flakes.
// Alternativly the returned Transport (t) should override CloseIdleConnections to
Expand Down

0 comments on commit 2bc748f

Please sign in to comment.