-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
net/http: HTTP/2 client retains an extra connection when client conn not usable
path is reached
#59155
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Change https://go.dev/cl/477876 mentions this issue: |
gopherbot
pushed a commit
to golang/net
that referenced
this issue
Mar 20, 2023
On the shouldRetryRequest path, err is invariantly nil, and therefore meaningless to log with vlogf. Instead, log the original error returned by the call to cc.RoundTrip. For golang/go#59155. Change-Id: I82c00a6033d0e92c28a5ccf60a87eec1c8b41886 Reviewed-on: https://go-review.googlesource.com/c/net/+/477876 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Damien Neil <dneil@google.com>
client conn not usable
path is reached
Change https://go.dev/cl/477856 mentions this issue: |
Found new dashboard test flakes for:
2023-03-20 22:54 linux-amd64-longtest-race go@b98c1b22 net/http.TestTransportIdleConnTimeout (log)
|
Found new dashboard test flakes for:
2023-03-22 18:50 linux-amd64-longtest-race go@09f1ddb1 net/http.TestTransportIdleConnTimeout (log)
|
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
After CL 477196,
TestTransportIdleConnTimeout/h2
occasionally fails with an extra connection (https://build.golang.org/log/3ad51e846979ee007b5a6bcae73ea5f5917d6a85):This failure mode seems exclusive to the
h2
subtest — the HTTP/1 test does not seem to be affected.I tried playing with the
time.Sleep(timeout / 2)
call in thedoReq
loop, and found that the failures are correlated to theSleep
: a longer sleep produces a higher probability of an extra connection.I added some debug logging, and found that in a successful run each request makes two
GetClientConn
calls from(*Transport).roundTrip
:transport.go:549
via(*http2noDialH2RoundTripper).RoundTrip
, and returnshttp2ErrNoCachedConn
which becomesErrSkipAltProtocol
.transport.go:591
, and successfully callsReserveNewRequest
on a cached connection.In a failing run, during the second
doReq
call theReserveNewRequest
path is taken first, andRoundTrip
on it fails withhttp2: client conn not usable
. The retry hits thehttp2ErrNoCachedConn
path, and the rest of the request falls through to the secondary path as usual. It appears that something about the extra retry causes an additional connection to be added to the pool.(attn @neild)
The text was updated successfully, but these errors were encountered: