-
Notifications
You must be signed in to change notification settings - Fork 18.1k
net/http: fix HTTP/2 idle pool tracing #34283
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
Conversation
CL 140357 caused HTTP/2 connections to be put in the idle pool, but failed to properly guard the trace.GotConn call in getConn. dialConn returns a minimal persistConn with conn == nil for HTTP/2 connections. This persistConn was then returned from queueForIdleConn and caused the httptrace.GotConnInfo passed into GotConn to have a nil Conn field. HTTP/2 connections call GotConn themselves so leave it for HTTP/2 to call GotConn as is done below.
This PR (HEAD: 7e1634c) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/195237 to see it. Tip: You can toggle comments from me using the |
Message from Tom Thorogood: Patch Set 1: I'm presuming this needs some sort of test, but I'm not quite sure how to write one. It needs a HTTP/2 connection to come from the idle pool. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
This PR (HEAD: 677ad13) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/195237 to see it. Tip: You can toggle comments from me using the |
Message from Cuong Manh Le: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Tom Thorogood: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Brad Fitzpatrick: Patch Set 2: Could you add a test for this? You should be able to tweak/copy one of the existing ones. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
This PR (HEAD: 2b7d66a) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/195237 to see it. Tip: You can toggle comments from me using the |
Message from Tom Thorogood: Patch Set 3:
The added test fails without this CL and passes with it. It also seems the simplest test I can think of, Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Michael Fraenkel: Patch Set 3: I believe TestTransportEventTrace_h2 should also be fixed to guarantee we do not log a GotConn for h2. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Tom Thorogood: Patch Set 3:
I don't think an explicit test is needed, because TestTransportEventTrace_h2 already fails if the other w.pc.alt == nil check is missing. --- FAIL: TestTransportEventTrace_h2 (0.00s) Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Michael Fraenkel: Patch Set 3:
When I run it with or without your change I don't see a failure. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Tom Thorogood: Patch Set 3:
Ah I thought you were referring to the other Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Michael Fraenkel: Patch Set 3: Code-Review+1 Gotcha. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Brad Fitzpatrick: Patch Set 3: Run-TryBot+1 Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Gobot Gobot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=f2842e36 Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
Message from Gobot Gobot: Patch Set 3: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/195237. |
CL 140357 caused HTTP/2 connections to be put in the idle pool, but failed to properly guard the trace.GotConn call in getConn. dialConn returns a minimal persistConn with conn == nil for HTTP/2 connections. This persistConn was then returned from queueForIdleConn and caused the httptrace.GotConnInfo passed into GotConn to have a nil Conn field. HTTP/2 connections call GotConn themselves so leave it for HTTP/2 to call GotConn as is done directly below. Fixes #34282 Change-Id: If54bfaf6edb14f5391463f908efbef5bb8a5d78e GitHub-Last-Rev: 2b7d66a GitHub-Pull-Request: #34283 Reviewed-on: https://go-review.googlesource.com/c/go/+/195237 Reviewed-by: Michael Fraenkel <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
This PR is being closed because golang.org/cl/195237 has been merged. |
CL 140357 caused HTTP/2 connections to be put in the idle pool, but failed to properly guard the trace.GotConn call in getConn. dialConn returns a minimal persistConn with conn == nil for HTTP/2 connections. This persistConn was then returned from queueForIdleConn and caused the httptrace.GotConnInfo passed into GotConn to have a nil Conn field. HTTP/2 connections call GotConn themselves so leave it for HTTP/2 to call GotConn as is done directly below. Fixes #34285 Change-Id: If54bfaf6edb14f5391463f908efbef5bb8a5d78e GitHub-Last-Rev: 2b7d66a GitHub-Pull-Request: #34283 Reviewed-on: https://go-review.googlesource.com/c/go/+/195237 Reviewed-by: Michael Fraenkel <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit 582d519) Reviewed-on: https://go-review.googlesource.com/c/go/+/196579 Reviewed-by: Daniel Martí <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Run-TryBot: Daniel Martí <[email protected]>
CL 140357 caused HTTP/2 connections to be put in the idle pool, but
failed to properly guard the trace.GotConn call in getConn. dialConn
returns a minimal persistConn with conn == nil for HTTP/2 connections.
This persistConn was then returned from queueForIdleConn and caused the
httptrace.GotConnInfo passed into GotConn to have a nil Conn field.
HTTP/2 connections call GotConn themselves so leave it for HTTP/2 to call
GotConn as is done directly below.
Fixes #34282