]> Cypherpunks repositories - gostls13.git/commit
net/http: in the IdleConnStrsForTesting_h2 helper, omit conns that cannot be reused
authorBryan C. Mills <bcmills@google.com>
Mon, 20 Mar 2023 20:19:45 +0000 (16:19 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 22 Mar 2023 20:51:27 +0000 (20:51 +0000)
commit11c40e349760792d0a2016633dc809025ee24b2f
treee540af552a591393081c388f35d9b5bf5b91fc24
parent4d9beb2052f9ee22901afe7ad0776e375ff581e7
net/http: in the IdleConnStrsForTesting_h2 helper, omit conns that cannot be reused

In #59155, we observed that the IdleConnStrsForTesting_h2 helper
function sometimes reported extra connections after a
"client conn not usable" failure and retry. It turns out that that
state corresponds exactly to the
http2clientConnIdleState.canTakeNewRequest field, so (with a bit of
extra nethttpomithttp2 plumbing) we can use that field in the helper
to filter out the unusable connections.

Fixes #59155.

Change-Id: Ief6283c9c8c5ec47dd9f378beb0ddf720832484e
Reviewed-on: https://go-review.googlesource.com/c/go/+/477856
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/net/http/export_test.go
src/net/http/omithttp2.go
src/net/http/transport_test.go