Skip to content

Discard DATA frames received on streams refused prior to activation - #1540

Merged
arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:h2-reserved-stream-graceful-shutdown-fix
Nov 28, 2026
Merged

arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:h2-reserved-stream-graceful-shutdown-fix

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Streams refused during connection shutdown are never activated and remain flagged as reserved; DATA in flight on such streams must not be treated as a connection PROTOCOL_ERROR (regression from 814622c).

Streams refused during connection shutdown are never activated and remain flagged as reserved; DATA in flight on such streams must not be treated as a connection PROTOCOL_ERROR (regression from 814622c).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the HTTP/2 graceful-shutdown fix.

No open issues 🎉

What changed in this PR

Fixes an HTTP/2 graceful-shutdown regression where in-flight DATA on streams refused before activation could trigger a connection-level protocol error and disrupt existing exchanges.

Changes:

  • Exempts locally reset streams from the reserved-stream DATA rejection.
  • Exposes the local-reset state through H2Stream.
  • Adds a regression test verifying that DATA on a refused stream does not prevent an existing stream from continuing.
File Description
httpcore5-h2/​src/​test/​java/​org/​apache/​hc/​core5/​http2/​impl/​nio/​TestAbstractH2StreamMultiplexer.java Tests refused-stream DATA handling during graceful shutdown.
httpcore5-h2/​src/​main/​java/​org/​apache/​hc/​core5/​http2/​impl/​nio/​H2Stream.java Adds an accessor for the channel’s local-reset state.
httpcore5-h2/​src/​main/​java/​org/​apache/​hc/​core5/​http2/​impl/​nio/​AbstractH2StreamMultiplexer.java Allows locally reset reserved streams to bypass the protocol-error check.

Review effort: Balanced

@ok2c ok2c added this to the 5.5.1 milestone Nov 28, 2026
@arturobernalg
arturobernalg merged commit d4d92e7 into apache:master Nov 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants