GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reject new HTTP/2 streams after receiving GOAWAY by snoopuppy582 · Pull Request #17458 · netty/netty

Conversation

@snoopuppy582

@snoopuppy582 snoopuppy582 commented Sep 14, 2026

Copy link
Copy Markdown

Motivation:

Receiving GOAWAY with a high Last-Stream-ID still allows new local streams to be created. Buffered requests below that ID also remain queued even though they have not been sent. This includes the maximum Last-Stream-ID used to begin graceful shutdown.

Modification:

Reject new local streams and push reservations after receiving GOAWAY. Fail all buffered writes and release their data, removing each pending stream before notifying its promises. Prevent callbacks from resuming the queue after GOAWAY.

The regression tests cover both endpoints, both HEADERS overloads, queued DATA and callbacks that create capacity during cancellation. Existing streams, previously reserved push streams and remote streams already in flight remain usable.

Result:

Fixes #17441.

Validation on Windows with Temurin 17.0.19 and the Maven 3.9.11 wrapper:

  • The three focused test classes ran 139 cases: 12 failures before the fix, all passing afterward.
  • mvnw.cmd -B -ntp -pl codec-http2 verify: 1,604 cases, 0 failures/errors, 7 skipped; Checkstyle and API compatibility checks passed.

The implementation, regression tests and this description were developed with Codex.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@snoopuppy582
Reject new HTTP/2 streams after receiving GOAWAY
b11380c
Motivation:

A GOAWAY with a high Last-Stream-ID still permits new local streams.
Buffered requests below that ID also remain queued even though they
have not been sent and can no longer be opened on the connection.

Modifications:

Reject new local streams and push reservations after receiving GOAWAY.
Fail all buffered writes and release their data, removing each pending
stream before notifying its promises. Prevent reentrant callbacks from
resuming pending streams after GOAWAY.

Add regression coverage for both endpoints, HEADERS overloads, buffered
data and reentrant callbacks, while preserving existing streams and
remote streams already in flight.

Result:

Fixes netty#17441.
@normanmaurer
normanmaurer requested review from bryce-anderson and ejona86 September 14, 2026 07:12
@normanmaurer

normanmaurer commented Sep 14, 2026

Copy link
Copy Markdown
Member

@snoopuppy582 did you sign our icla yet ? https://netty.io/s/icla

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@snoopuppy582

snoopuppy582 commented Sep 14, 2026

Copy link
Copy Markdown
Author

Yes, I have submitted the ICLA. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer requested a review from violetagg September 14, 2026 09:05
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 14, 2026
normanmaurer
normanmaurer reviewed Sep 14, 2026
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer
normanmaurer requested changes Sep 14, 2026
View reviewed changes
Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/StreamBufferingEncoder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Address code review feedback on GOAWAY stream rejection
b70177f
- Move the GOAWAY-received check in checkNewStreamAllowed() after the
  stream-ID validity and closed-stream checks, so more specific errors
  (Http2NoMoreStreamIdsException, "behind next expected stream") are no
  longer masked by a generic REFUSED_STREAM once any GOAWAY has been
  received.
- Extract the duplicated pending-stream drain/close loop in
  StreamBufferingEncoder into a shared static failAllPendingStreams()
  helper, used by both close() and cancelGoAwayStreams(), and avoid
  allocating the failure exception when there are no pending streams.
normanmaurer
normanmaurer approved these changes Sep 16, 2026
View reviewed changes
bryce-anderson
bryce-anderson approved these changes Sep 16, 2026
View reviewed changes
Comment thread codec-http2/src/test/java/io/netty/handler/codec/http2/StreamBufferingEncoderTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Address review feedback from bryce-anderson on PR netty#17458
c64e292
- Move the GOAWAY-received check below the nextStreamIdToCreate <= 0
  check in checkNewStreamAllowed(), since the stream-ID-exhaustion
  error is more specific.
- Use Integer.MAX_VALUE as the GOAWAY last-stream-id in
  receivingGoAwayFailsBufferedStreams, since none of the buffered
  streams were sent and will fail regardless of the specific value.
@testlens-app

testlens-app Bot commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: c64e292
▶️ Tests: 815 executed
⚪️ Checks: 25/25 completed


Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

violetagg
violetagg approved these changes Sep 22, 2026
View reviewed changes
@normanmaurer normanmaurer modified the milestones: 4.2.19.Final, 4.2.20.Final Oct 14, 2026
@snoopuppy582
Merge branch '4.2' into fix/17441-goaway-new-streams
56f2568
@chrisvest chrisvest modified the milestones: 4.2.20.Final, 4.2.21.Final Nov 2, 2026
@chrisvest chrisvest modified the milestones: 4.2.21.Final, 4.2.22.Final Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes
@violetagg violetagg violetagg approved these changes
@bryce-anderson bryce-anderson bryce-anderson approved these changes
@ejona86 ejona86 Awaiting requested review from ejona86

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.22.Final

Development

Successfully merging this pull request may close these issues.

New local streams can still be created after receiving GOAWAY

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@snoopuppy582 @normanmaurer @violetagg @bryce-anderson @chrisvest
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.