Repository navigation
fix(h2): reset a backend stream answered before its request was written - #1741
Merged
Merged
Conversation
FlorentinDUBOIS
force-pushed
the
fix/h2-backend-early-response-slot
branch
from
October 1, 2026 14:09
967b522 to
b0cd491
Compare
ConnectionH2::end_stream skipped the RST_STREAM on a backend stream once the response's END_STREAM was read and the request was received whole, even when the rest of the request was still queued toward the backend. A backend that answered early (RFC 9113 §8.1) then never saw END_STREAM and kept the stream half-closed, holding one of its SETTINGS_MAX_CONCURRENT_STREAMS slots (§5.1.2) for the connection's lifetime. The skip now also requires the request to have been handed to the output whole (front.is_completed()); otherwise the stream is reset once with RST_STREAM(CANCEL). Fixes #1734 Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
force-pushed
the
fix/h2-backend-early-response-slot
branch
from
October 1, 2026 19:08
b0cd491 to
f6e7cb4
Compare
Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS
added a commit
that referenced
this pull request
Oct 1, 2026
a_backend_stream_answered_before_its_request_was_written_is_cancelled, added with #1741, withholds the backend's send window by setting Stream::window to 0. This branch splits that field into front_window and back_window, one per connection (RFC 9113 section 6.9), so after main was merged in the test no longer compiled: the two changes touched different lines and merged without a textual conflict. The test drives the stream on its backend connection, whose send window is now back_window (Stream::send_window_mut picks the leg from the connection's Position). Set that leg to 0 so the request body still waits behind its HEADERS, as the test intends. Signed-off-by: Florentin Dubois <[email protected]>
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.
ConnectionH2::end_streamskipped the RST_STREAM on a backend stream once the response's END_STREAM was read and the request was received whole, even when the rest of the request was still queued toward the backend. A backend that answered early (RFC 9113 §8.1) never saw END_STREAM and kept the stream half-closed, counting against itsSETTINGS_MAX_CONCURRENT_STREAMS(§5.1.2) for the connection's lifetime.The skip now also requires the request to have been handed to the output whole (
front.is_completed()). Otherwise the stream is reset once with RST_STREAM(CANCEL).a_backend_stream_answered_before_its_request_was_written_is_cancelledLIFECYCLE.mdand CHANGELOG updated. Three pinned citations indoc/h2_mux_internals.mdwere repointed after the line shift.Fixes #1734