Skip to content
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

net/http: TestRequestLimit/h2 becomes significantly more expensive and slower after x/net@v0.23.0 [1.22 backport] #66698

Closed
gopherbot opened this issue Apr 5, 2024 · 7 comments
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link

@neild requested issue #66668 to be considered for backport to the next 1.22 minor release.

@gopherbot please open backport issues. This is a bug/deficiency in a previous cherrypick, so we should backport the fix as well.

@dmitshur
Copy link
Contributor

dmitshur commented Apr 5, 2024

should backport the fix as well

To clarify, do you think the fix to be backported should include changes in CL 576756 and CL 576895?

@neild
Copy link
Contributor

neild commented Apr 8, 2024

Just https://go.dev/cl/576756 (sending the correct LastStreamID), which is a bugfix/refinement of the previously backported security fix. https://go.dev/cl/576895 is an improvement to the client behavior, I think, but not directly related.

@cagedmantis
Copy link
Contributor

Approved as this is a serious performance regression that was introduced by a fix.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Apr 10, 2024
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Apr 10, 2024
@gopherbot
Copy link
Author

Change https://go.dev/cl/578338 mentions this issue: [internal-branch.go1.22-vendor] http2: send correct LastStreamID in stream-caused GOAWAY

@gopherbot
Copy link
Author

Change https://go.dev/cl/578337 mentions this issue: [internal-branch.go1.22-vendor] http2: fix TestServerContinuationFlood flakes

gopherbot pushed a commit to golang/net that referenced this issue Apr 12, 2024
…d flakes

This test causes the server to send a GOAWAY and close a connection.
The server GOAWAY path writes a GOAWAY frame asynchronously, and
closes the connection if the write doesn't complete within 1s.
This is causing failures on some builders, when the frame write
doesn't complete in time.

The important aspect of this test is that the connection be closed.
Drop the check for the GOAWAY frame.

This is a test-only fix that has no effect on the vendored content,
helps tests on this branch, and avoids a merge conflict in next CL.

For golang/go#66698.

Change-Id: I099413be9c4dfe71d8fe83d2c6242e82e282293e
Reviewed-on: https://go-review.googlesource.com/c/net/+/576235
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/net/+/578337
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
gopherbot pushed a commit to golang/net that referenced this issue Apr 12, 2024
…tream-caused GOAWAY

When closing a connection because a stream contained a request we
didn't like (for example, because the request headers exceed
the maximum we will accept), set the LastStreamID in the GOAWAY
frame to include the offending stream. This informs the client
that retrying the request is unlikely to succeed, and avoids
retry loops.

This change requires passing the stream ID of the offending
stream from Framer.ReadFrame up to the caller. The most sensible
way to do this would probably be in the error. However,
ReadFrame currently returns a defined error type for
connection-ending errors (ConnectionError), and that type is a
uint32 with no place to put the stream ID. Rather than changing
the returned errors, ReadFrame now returns an error along with
a non-nil Frame containing the stream ID, when a stream is
responsible for a connection-ending error.

Merge conflicts were avoided by cherry-picking CL 576235 (test deflake)
prior to this, and then by squashing CL 576175 (typo fix) into this CL.

For golang/go#66668.
For golang/go#66698.

Change-Id: Iba07ccbd70ab4939aa56903605474d01703ac6e4
Reviewed-on: https://go-review.googlesource.com/c/net/+/576756
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/net/+/578338
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
@gopherbot
Copy link
Author

Change https://go.dev/cl/578358 mentions this issue: [release-branch.go1.22] net/http: update bundled golang.org/x/net/http2

gopherbot pushed a commit that referenced this issue Apr 12, 2024
Pull in CL 578338:

	db050b07 http2: send correct LastStreamID in stream-caused GOAWAY

For #66668.
Fixes #66698.

Change-Id: Ie7cbc44cd559eb8bc34f6c4ad4ead678ec2f55ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/578358
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Author

Closed by merging d6c972a to release-branch.go1.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

4 participants