-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/http2: orphan http handler when h2 connection closed #37920
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
Fixes golang/go#37920 Signed-off-by: detailyang <detailyang@gmail.com>
Change https://golang.org/cl/223899 mentions this issue: |
/cc @bradfitz @tombergan |
cc @fraenkel |
@detailyang I am struggling with where you think the issue lies. In both the play link and your testcase, you have opted to use ServeConn which states that it will block until the connection is no longer readable. |
@fraenkel AFAIK, The lifecycle of HTTP handlers should be the same as the ServeConn. |
From the documentation (https://godoc.org/golang.org/x/net/http2#Server.ServeConn) |
@fraenkel the ServeConn should block until the connection is no longer readable and all the handler finished, more detail see the PR golang/net#66 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yep
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Now the http2 server directly exits the connection loop without waiting all handlers done which causes the HTTP handler orphan as the following: https://github.com/golang/net/blob/244492dfa37ae2ce87222fd06250a03160745faa/http2/server.go#L806
Online Go Play Here: https://play.golang.org/p/m6m2aKIlRCJ
Shouldn't we wait for all handlers finished then exit?
What did you expect to see?
See the output "handler stop"
What did you see instead?
nothing
The text was updated successfully, but these errors were encountered: