Repository navigation
Clarify stream flow-control comment; add RST_STREAM regression test - #1133
arturobernalg wants to merge 1 commit into
Conversation
bd40850 to
8187cd7
Compare
|
The original change (StreamException → ConnectionException) was incorrect. Confirmed regression in TestCancelledUpload.testCancelledRequest: when a servlet rejects a large upload early (reads 128 bytes, returns 403), in-flight DATA frames can exceed the remaining stream buffer, triggering the same code path. Killing the entire connection in that scenario is wrong. The Updated the commit to revert Http2Parser.java to throw StreamException and corrected the test to assert RST_STREAM(FLOW_CONTROL_ERROR) instead of GOAWAY. All 20 tests in TestHttp2Section_6_9 and both tests in TestCancelledUpload pass. |
When a DATA frame payload exceeds the remaining capacity of the stream's receive buffer, Http2Parser throws StreamException(FLOW_CONTROL_ERROR), resulting in RST_STREAM. This is a stream-level check: the inBuffer is scoped to the per-stream initial window, so the violation affects only that stream; the connection and other streams remain open. RFC 9113, section 6.9, permits either a stream error or a connection error for this case (MAY). Tomcat's choice of RST_STREAM is correct and avoids unnecessary collateral damage to multiplexed streams. Adds TestHttp2Section_6_9.testDataFrameExceedsFlowControlWindow as a regression guard for this behavior.
8187cd7 to
217da04
Compare
When a DATA frame payload exceeds the remaining capacity of a stream's receive buffer,
Http2ParserthrowsStreamException(FLOW_CONTROL_ERROR), resulting inRST_STREAM. The connection and all other multiplexed streams remain open.The stream-level
inBufferis sized to the per-stream initial window (SETTINGS_INITIAL_WINDOW_SIZE). A violation of that buffer is a stream-scoped error. RFC 9113, section 6.9, permits either a stream error or a connection error for this case (MAY — not MUST). Tomcat's existing choice ofRST_STREAMis correct and avoids unnecessary collateral damage to concurrent streams.This PR:
Http2Parser.processFrameDatathat incorrectly cited a "MUST connection error" requirement.TestHttp2Section_6_9.testDataFrameExceedsFlowControlWindowas a regression guard, verifying that a DATA frame exceeding the stream window producesRST_STREAM(FLOW_CONTROL_ERROR)and leaves the connection open.