net/http: client closes persistent connections when context deadline is exceeded without reuse #45559
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran into a scenario while using the http client, when there is a surge in the number of requests and in certain requests when context deadline is exceeded at the client side.
What did you expect to see?
Persistent connection remains intact when not explicitly closed due to request context timeouts.
What did you see instead?
Persistent connections should be reused. But a lot of new dials happen due to closing of persistent connections which could have been potentially avoided.
Relevant code in question: https://github.com/golang/go/blob/master/src/net/http/transport.go#L2219
The text was updated successfully, but these errors were encountered: