-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/http2: if http1 Server's keep-alives are disabled, only do one request #17717
Comments
HTTP/2 does not support http://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2
The HTTP/2 protocol is centered around the idea of multiple requests per connection. If someone wants one request per connection, they should just use HTTP/1. Maybe just update the SetKeepAliveEnabled docs? |
Yeah, simplest case is just documentation. Or we could even change the advertised ALPN protos at runtime to exclude "h2" if keep-alives are disabled. But h2 + immediate GOAWAY after first response isn't really worse than h1 + "Connection: close". |
CL https://golang.org/cl/33153 mentions this issue. |
Sounds like there was a decision since there is now a CL. Change to NeedsFix? |
If the user is using Server.SetKeepAlivesEnabled(false), assume they have a reason and respect it. Make HTTP/2 behave like HTTP/1 (except a bit nicer, since we have GOAWAY). Updates golang/go#17717 Change-Id: I4a5ce324f0ac8653d83e75029063cd2e270a1048 Reviewed-on: https://go-review.googlesource.com/33153 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
CL https://golang.org/cl/33231 mentions this issue. |
As part of #9478, I noticed the HTTP/2 server doesn't respect SetKeepAlivesEnabled.
Do that.
After the first http2 Server response, check:
And if it's false, start a graceful GOAWAY shutdown.
/cc @tombergan
The text was updated successfully, but these errors were encountered: