From a003f68f92d27dffcc86361808511042a49ece30 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Wed, 23 Oct 2024 08:32:19 -0700 Subject: [PATCH] feat(http): set ResponseHeaderTimeout (#1777) fix(http): implement ResponseHeaderTimeout --- pkg/sharedhttp/http.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkg/sharedhttp/http.go b/pkg/sharedhttp/http.go index 83256cd..387d1d7 100644 --- a/pkg/sharedhttp/http.go +++ b/pkg/sharedhttp/http.go @@ -18,12 +18,13 @@ var Transport = &http.Transport{ Timeout: 30 * time.Second, // default transport value KeepAlive: 30 * time.Second, // default transport value }).DialContext, - ForceAttemptHTTP2: true, // default is true; since HTTP/2 multiplexes a single TCP connection. we'd want to use HTTP/1, which would use multiple TCP connections. - MaxIdleConns: 100, // default transport value - MaxIdleConnsPerHost: 10, // default is 2, so we want to increase the number to use establish more connections. - IdleConnTimeout: 90 * time.Second, // default transport value - TLSHandshakeTimeout: 10 * time.Second, // default transport value - ExpectContinueTimeout: 1 * time.Second, // default transport value + ForceAttemptHTTP2: true, // default is true; since HTTP/2 multiplexes a single TCP connection. + MaxIdleConns: 100, // default transport value + MaxIdleConnsPerHost: 10, // default is 2, so we want to increase the number to use establish more connections. + IdleConnTimeout: 90 * time.Second, // default transport value + ResponseHeaderTimeout: 120 * time.Second, // servers can respond slowly - this should fix some portion of releases getting stuck as pending. + TLSHandshakeTimeout: 10 * time.Second, // default transport value + ExpectContinueTimeout: 1 * time.Second, // default transport value ReadBufferSize: 65536, WriteBufferSize: 65536, TLSClientConfig: &tls.Config{ @@ -37,12 +38,13 @@ var TransportTLSInsecure = &http.Transport{ Timeout: 30 * time.Second, // default transport value KeepAlive: 30 * time.Second, // default transport value }).DialContext, - ForceAttemptHTTP2: true, // default is true; since HTTP/2 multiplexes a single TCP connection. we'd want to use HTTP/1, which would use multiple TCP connections. - MaxIdleConns: 100, // default transport value - MaxIdleConnsPerHost: 10, // default is 2, so we want to increase the number to use establish more connections. - IdleConnTimeout: 90 * time.Second, // default transport value - TLSHandshakeTimeout: 10 * time.Second, // default transport value - ExpectContinueTimeout: 1 * time.Second, // default transport value + ForceAttemptHTTP2: true, // default is true; since HTTP/2 multiplexes a single TCP connection. + MaxIdleConns: 100, // default transport value + MaxIdleConnsPerHost: 10, // default is 2, so we want to increase the number to use establish more connections. + IdleConnTimeout: 90 * time.Second, // default transport value + ResponseHeaderTimeout: 120 * time.Second, // servers can respond slowly - this should fix some portion of releases getting stuck as pending. + TLSHandshakeTimeout: 10 * time.Second, // default transport value + ExpectContinueTimeout: 1 * time.Second, // default transport value ReadBufferSize: 65536, WriteBufferSize: 65536, TLSClientConfig: &tls.Config{