Repository navigation
Ignore DATA frames received on a stream reset before any DATA arrived - #1250
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
RFC 9113, section 5.1 requires an endpoint that has reset a stream to minimally process and then discard the frames it receives on it. When a stream was closed before any DATA frame had been processed, the replacement RecycledStream was created with no flow control window left. A client that had already sent DATA, well inside the window it was allowed, was answered with a RST_STREAM (FLOW_CONTROL_ERROR) for every frame and, as each of those counts towards the overhead limit, the whole connection was then closed with a GOAWAY (ENHANCE_YOUR_CALM). This happens, for example, when a request is rejected without its body being read. Create the RecycledStream with the full initial window when no DATA frame has been received.
arturobernalg
force-pushed
the
h2-data-after-reset
branch
from
November 20, 2026 16:07
4fa17a2 to
e7516f3
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 requires an endpoint that has reset a stream to "minimally process and then discard" the frames it receives on it, as the client may have sent them before it saw the reset.
When a stream is closed before any DATA frame has been processed, Stream.replace() creates the RecycledStream with no flow control window left, so any DATA that is still in flight is answered with RST_STREAM (FLOW_CONTROL_ERROR). Each of those counts towards the overhead limit, so after a few frames the connection is closed with GOAWAY (ENHANCE_YOUR_CALM), which also kills every other stream on it. This happens, for example, when a request is rejected without its body being read.
As no DATA has been received, the client still has the whole initial window available. Create the RecycledStream with it. A client that really exceeds the window is still reset.
Checked against a running Tomcat with a raw HTTP/2 client, sending DATA to a stream the server had just reset: without the change 100 bytes already got a RST_STREAM, and 49 KiB (inside the window) got two of them and a GOAWAY that closed the connection. With it the frames are ignored and the connection stays usable. 80 KiB, which exceeds the window, is still reset. The HTTP/2 test suite passes.
This is the stream the server reset (CLOSED_RST_TX), not the one handled by #1129.