Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: TestTransportRemovesH2ConnsAfterIdle/h2 failures #70515

Open
gopherbot opened this issue Nov 22, 2024 · 6 comments
Open

net/http: TestTransportRemovesH2ConnsAfterIdle/h2 failures #70515

gopherbot opened this issue Nov 22, 2024 · 6 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "net/http" && test == "TestTransportRemovesH2ConnsAfterIdle/h2"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestTransportRemovesH2ConnsAfterIdle/h2
2024/11/22 02:11:36 Error enabling Transport HTTP/2 support: protocol https already registered
    transport_test.go:4259: got error: Get "https://127.0.0.1:46039": http2: client conn could not be established
--- FAIL: TestTransportRemovesH2ConnsAfterIdle/h2 (0.01s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 22, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "net/http" && test == "TestTransportRemovesH2ConnsAfterIdle/h2"
2024-11-22 02:04 gotip-linux-amd64-longtest-noswissmap go@d524c954 net/http.TestTransportRemovesH2ConnsAfterIdle/h2 (log)
=== RUN   TestTransportRemovesH2ConnsAfterIdle/h2
2024/11/22 02:11:36 Error enabling Transport HTTP/2 support: protocol https already registered
    transport_test.go:4259: got error: Get "https://127.0.0.1:46039": http2: client conn could not be established
--- FAIL: TestTransportRemovesH2ConnsAfterIdle/h2 (0.01s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "net/http" && test == "TestTransportRemovesH2ConnsAfterIdle/h2"
2024-11-22 03:48 gotip-linux-386-longtest go@b299e9a4 net/http.TestTransportRemovesH2ConnsAfterIdle/h2 (log)
=== RUN   TestTransportRemovesH2ConnsAfterIdle/h2
2024/11/22 03:58:57 Error enabling Transport HTTP/2 support: protocol https already registered
    transport_test.go:4259: got error: Get "https://127.0.0.1:40031": http2: client conn could not be established
--- FAIL: TestTransportRemovesH2ConnsAfterIdle/h2 (0.05s)

watchflakes

@dmitshur dmitshur moved this to Active in Test Flakes Nov 22, 2024
@dmitshur
Copy link
Contributor

These "Error enabling Transport HTTP/2 support: protocol https already registered" errors may be fairly new, and if so maybe related to recent net/http changes. Also seeing them in #70299. CC @neild.

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/631795 mentions this issue: net/http: test for racing idle conn closure and new requests

@neild
Copy link
Contributor

neild commented Nov 25, 2024

This is caused by a bug introduced in https://go.dev/cl/625398:

As of that CL, when a client connection encounters an error prior to the first request being sent on it, we fail that request. For example, if the server immediately closes a new connection before we have a chance to send a request, we treat that as a failure on the assumption that trying again will get the same result. (Previously, we'd say "oh, we don't have any usable connections", and retry on a new connection--which would probably fail again in the same way.)

The bug is that when the connection idle timer races with the first request on a connection, this can result in that first request failing. This is unlikely to happen in the real world, since it requires a very short idle timer and a new connection which has somehow made it into the pool without being used. Even in tests, it requires some fairly unlucky timing to appear.

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/631815 mentions this issue: http2: do not surface errors from a conn's idle timer expiring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Active
Development

No branches or pull requests

3 participants