x/net/http2: Strict handling of http.Transport.DisableKeepAlives in http2 #33260
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What did you do?
Using a
http.Transport
withhttp.Client
and multiple concurrent outgoing http(s) connections. Basically load testing an http(s) endpoint.Set
http.Transport.DisableKeepAlives
totrue
to enforce a single connection for each request.What did you expect to see?
I was expecting to see n connections for n requests. This is true for http(s)/1.1 but http2 is re-using connections even though
http.Transport.DisableKeepAlives
istrue
.I understand that this is not strictly a http2 feature but gets translated to http2 in
func (t *http2Transport) disableKeepAlives() bool
and thus should have the same meaning.What did you see instead?
Works for http(s)/1.1 but http2 connections get re-used. In a test with
n
requests and a concurrency ofc
only ~c
connections where used (instead of expectedn
connections).How to fix?
See here: golang/net#48
Related issues
The text was updated successfully, but these errors were encountered: