Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h3: earlier check for control and QPACK stream termination #1852

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

LPardue
Copy link
Contributor

@LPardue LPardue commented Sep 26, 2024

h3: earlier checks for control and QPACK stream termination

A peer can FIN or reset a control stream at any point during the stream
lifetime. While doing so is an error in HTTP/3, our handling before this change
was a bit odd.

Previously, depending on the sequencing, an unexpected termination of such a
stream could trigger an InvalidStreamState or StreamReset error during poll().
This would bubble up to the app, which is weird and unexpected because the
quiche h3 layer is supposed to deal with all the control stream details. While
both those errors contain a stream ID, the app isn't given any info that the ID
is a control stream.

While any subsequent call to poll() would then cause the stream_finished
detection to kick in and enforce the RFC rules to close the connection with
CloseCriticialStream, that's a bit late and clunky.

This change adds additional checks for the control and QPACK stream terminations
in order to make sure we close connections at the earliest time and prevent
useless errors getting bubbled up to apps.

@LPardue LPardue force-pushed the early-control-stream-termination-checks branch 2 times, most recently from fbfb9b9 to 0de460f Compare September 27, 2024 01:07
@LPardue LPardue marked this pull request as ready for review September 27, 2024 01:10
@LPardue LPardue requested a review from a team as a code owner September 27, 2024 01:10
@LPardue LPardue changed the title h3: earlier check for control stream finished h3: earlier check for ontrol and QPACK stream termination Sep 27, 2024
quiche/src/h3/mod.rs Outdated Show resolved Hide resolved
@LPardue LPardue changed the title h3: earlier check for ontrol and QPACK stream termination h3: earlier check for control and QPACK stream termination Sep 27, 2024
A peer can FIN or reset a control stream at any point during the stream
lifetime. While doing so is an error in HTTP/3, our handling before this change
was a bit odd.

Previously, depending on the sequencing, an unexpected termination of such a
stream could trigger an InvalidStreamState or StreamReset error during poll().
This would bubble up to the app, which is weird and unexpected because the
quiche h3 layer is supposed to deal with all the control stream details. While
both those errors contain a stream ID, the app isn't given any info that the ID
is a control stream.

While any subsequent call to poll() would then cause the stream_finished
detection to kick in and enforce the RFC rules to close the connection with
CloseCriticialStream, that's a bit late and clunky.

This change adds additional checks for the control and QPACK stream terminations
in order to make sure we close connections at the earliest time and prevent
useless errors getting bubbled up to apps.
@LPardue LPardue force-pushed the early-control-stream-termination-checks branch from 0de460f to d2f5428 Compare September 27, 2024 18:13
@ghedo ghedo merged commit 9b4ca72 into master Sep 30, 2024
39 checks passed
@ghedo ghedo deleted the early-control-stream-termination-checks branch September 30, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants