feat(http): set ResponseHeaderTimeout (#1777)

fix(http): implement ResponseHeaderTimeout
This commit is contained in:
Kyle Sanderson 2024-10-23 08:32:19 -07:00 committed by GitHub
parent 8f2398a627
commit a003f68f92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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{