-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/http2: Shutdown closes active HTTP/2 connections #39919
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
Comments
There is an issue with your test. Shutdown() is synchronous. |
@fraenkel You're absolutely right, that indeed explains the behavior. I should have given the recipe I wrote back in January a closer look before opening this issue with it, I apologize for that. I've confirmed that by launching Shutdown() in a separate goroutine from within the handler, things appear to be working correctly: https://play.golang.org/p/4GnoUQ2Ld7N
|
That looks right. We should close this. |
What version of Go are you using (
go version
)?Built from https://golang.org/cl/240278 related to #36946 and #39776.
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Calling
Shutdown
inside the response handler for request 4 of an HTTP/2 connection causes the server to shutdown before the response for request 4 is written:https://play.golang.org/p/UtgaaHEJjYw
Here is sample output with
GODEBUG=http2debug=2
:GODEBUG=http2debug=2 go run main2.go
OutputWhat did you expect to see?
The server should wait until the response for request 4 is written before closing down the server.
What did you see instead?
The server is shutdown before the response is written.
/cc @fraenkel
The text was updated successfully, but these errors were encountered: