net/http: cherry-pick two upstream HTTP/2 fixes - #188
Merged
Merged
Conversation
…ded off to HTTP/2 HTTP/2 doesn't use net/http's bufio.Reader and Writer. Release the reader back to the pool before handing off a connection to HTTP/2, and don't allocate the Writer if we aren't going to use it. Updates golang#80735 Updates #174 Change-Id: I818a27fb94ecedb6b679942f739d08612aff8241 Reviewed-on: https://go-review.googlesource.com/c/go/+/833344 Reviewed-by: Nicholas Husin <nsh@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit a081f7d)
…e unencrypted HTTP/2 conns CL 831084 introduced a bug. Because conn.serve now returns as soon as the HTTP/2 serve goroutine parks, the deferred context cancel now fires while the connection is still being served. The unencrypted HTTP/2 path was handing that cancelable context to the HTTP/2 server, canceling every request context on the connection. Pass the connection context instead, as the TLS ALPN path already does. This is a cherry-pick of upstream CL 833444 (patchset 2), which is still pending submission at https://go-review.googlesource.com/c/go/+/833444. Adapted for this tree: the test passes optFakeNet to newClientServerTest. Upstream master's test harness defaults to the synctest fake network and this tree's harness only uses it when asked, so without that option the test's real listener keeps the synctest bubble from ever going idle and the test hangs. Updates golang#81524 Updates #174 Change-Id: Iea19fb46e4a0d111d90b86ca8390a4d50a3bde5a (cherry picked from commit becae1c545b2961c0fc6ee0dc9b87917aefa3a63)
bradfitz
added a commit
to tailscale/tailscale
that referenced
this pull request
Sep 16, 2026
For tailscale/go#188 Updates tailscale/corp#29053 Change-Id: I3d42156b3c2ef824b68033031d9be48fe7989176 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates #174