{{ message }}
Repository navigation
Conversation
This branch has not been deployed
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.

Description
Fixes #7408.
When a
ResetQuicStreamcommand arrives for a stream that aioquic has already retired,QuicLayer._handle_commandcalls_get_or_create_stream_for_send. For a peer-initiated stream that raisesValueError: Cannot send data on unknown peer-initiated stream, which is the crash in the issue. For a locally initiated stream it quietly recreates the stream instead.The fix skips the reset when the stream id is already in
self.quic._streams_finished. A finished stream has nothing left to reset, so dropping the late command is safe. This reads a private aioquic attribute, as the code right below it already does with_get_or_create_stream_for_sendand_reset_error_code.test_stream_reset_retiredretires a stream in each direction, for both client and server, and then sends a reset. Without the fix all four cases fail (theValueError, or the stream coming back); with it they pass. The fulltest/mitmproxy/proxysuite, ruff and mypy pass locally.Checklist