Model QUIC ConnectionClosed separately from ApplicationClose#336
Open
iadev09 wants to merge 1 commit intohyperium:masterfrom
Open
Model QUIC ConnectionClosed separately from ApplicationClose#336iadev09 wants to merge 1 commit intohyperium:masterfrom
iadev09 wants to merge 1 commit intohyperium:masterfrom
Conversation
Preserve transport-level shutdown semantics by mapping QUIC ConnectionClosed explicitly instead of falling back to Undefined.
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.
Summary
QUIC transport-level connection closures are currently mapped to
ConnectionErrorIncoming::Undefined, which erases type information and makes downstream handling rely on debug strings or heuristics.This change adds a dedicated
ConnectionClosed { error_code }variant toConnectionErrorIncomingand maps QUICConnectionClosederrors explicitly instead of treating them as undefined.QUIC ConnectionClosed(NO_ERROR) represents graceful shutdown and should not be treated as an undefined error.
What changed
ConnectionErrorIncoming::ConnectionClosed { error_code }quinn::ConnectionError::ConnectionClosed(...)explicitly inh3-quinnApplicationClosestrictly HTTP/3-levelUndefinedas the fallback for errors that still do not have a structured mappingNO_ERRORas graceful shutdown inConnectionError::is_h3_no_error()Why
ApplicationCloseand QUICConnectionClosedcarry different semantics and belong to different protocol layers.ApplicationCloseis an HTTP/3 application close.ConnectionClosedis a QUIC transport close.This PR keeps those separate instead of collapsing transport shutdown into
Undefined.This is also the connection-level equivalent of the fix in #315 for
StreamError::is_h3_no_error(), which already handles the stream-level case viaRemoteTerminate.Compatibility
This is a public enum API change:
ConnectionErrorIncominggains a newConnectionClosedvariant.That is not strictly backwards-compatible for exhaustive matches, but it avoids erasing structured QUIC transport shutdowns behind
Undefined, and matches the maintainer guidance that this crate can tolerate such updates in practice.Unlike an open-ended
Other(...)-style enum, this does not silently remap behavior at runtime; downstream exhaustive matches get a compile-time signal to handle the new transport-level case explicitly.Verification
cargo test -p h3-quinn connection_closed_is_mapped_to_structured_variantcargo check -p h3 -p h3-quinn -p h3-datagramRefs #325.