Repository navigation
Treat DATA on a RST-closed stream as a connection error per RFC 9113 §5.1 - #1129
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
arturobernalg
force-pushed
the
rfc9113-closed-stream-connection-error
branch
from
October 29, 2026 18:56
32ae7a8 to
f805a6d
Compare
Member
Author
|
Review addressed. Tests updated: testClosedInvalidFrame01 now drives stream 3 to CLOSED_TX via a full request/response cycle, then sends RST_STREAM to transition the server to CLOSED_RST_RX before verifying that DATA triggers a connection error. Two new tests added: testRstStreamAfterRstStreamReceived and testWindowUpdateAfterRstStreamReceived confirm the connection stays alive when RST_STREAM or WINDOW_UPDATE is received on a CLOSED_RST_RX stream. All tests pass. |
RFC 9113, section 5.1 permits an endpoint to treat receipt of any frame other than PRIORITY, WINDOW_UPDATE, or RST_STREAM on a closed stream as a connection error (Section 5.4.1) of type STREAM_CLOSED. The CLOSED_RST_RX state (stream closed because a RST_STREAM was received from the peer) had connectionErrorForInvalidFrame=false, so any frame not in the permitted set — in particular DATA — triggered a StreamException and caused the server to reply with a RST_STREAM (stream error) instead of closing the connection with GOAWAY (connection error). Fix: set connectionErrorForInvalidFrame=true for CLOSED_RST_RX so that unexpected frames such as DATA trigger a connection error (GOAWAY STREAM_CLOSED). Add RST and WINDOW_UPDATE to the permitted set so they are silently discarded as expected for in-flight frames after a reset. Update TestHttp2Section_5_1#testClosedInvalidFrame01 to assert the correct connection-error (GOAWAY STREAM_CLOSED) response.
arturobernalg
force-pushed
the
rfc9113-closed-stream-connection-error
branch
from
October 29, 2026 19:20
f805a6d to
c7a5df7
Compare
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.
RFC 9113, section 5.1 permits an endpoint to treat receipt of any frame other than PRIORITY, WINDOW_UPDATE, or RST_STREAM on a closed stream as a connection error (Section 5.4.1) of type STREAM_CLOSED.
The
CLOSED_RST_RXstate (stream closed because a RST_STREAM was received from the peer) hadconnectionErrorForInvalidFrame=false, so any frame not in the permitted set — in particular DATA — triggered aStreamException(stream error) and caused the server to reply with a RST_STREAM instead of closing the connection with GOAWAY.Fix: set
connectionErrorForInvalidFrame=trueforCLOSED_RST_RXso that unexpected frames such as DATA trigger a connection error (GOAWAY STREAM_CLOSED). Add RST and WINDOW_UPDATE to the permitted set so they are silently discarded as expected for in-flight frames after a reset.Update
TestHttp2Section_5_1#testClosedInvalidFrame01to assert the correct connection-error (GOAWAY STREAM_CLOSED) response.