Repository navigation
quic: leave time-wait connections to the time-wait list while a hot restart parent drains - #48206
Merged
RyanTheOptimist merged 1 commit intoOct 13, 2026
Conversation
…estart parent drains A draining hot restart parent's dispatcher reports every packet without a live session for forwarding to the new process, before quiche consults its time-wait list. Packets for connections the parent has just closed were therefore forwarded to the child, which never knew them and answered with a stateless reset instead of the parent re-sending the stored CONNECTION_CLOSE. Leave connection IDs in the time-wait list to quiche and forward only unknown ones. Guarded by envoy.reloadable_features.quic_hot_restart_time_wait_before_forward. Signed-off-by: Bruno Palermo <[email protected]>
Contributor
|
/assign @RyanTheOptimist |
RyanTheOptimist
approved these changes
Oct 13, 2026
RyanTheOptimist
left a comment
Contributor
There was a problem hiding this comment.
Oooh! Great find and nice fix!
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.
Commit Message: quic: leave time-wait connections to the time-wait list while a hot restart parent drains
Additional Description:
While a hot restart parent drains, its QUIC dispatcher stops accepting new connections and
EnvoyQuicDispatcher::OnFailedToDispatchPacketreports every packet without a live session as not dispatched, soActiveQuicListenerforwards it to the new process (#29585). That hook runs before quiche looks at its time-wait list, so "no live session" includes the connections this dispatcher has just closed itself, which is most of them during a drain. A late packet for one of those (a retransmission, or data sent before the peer saw the close) is forwarded to the child, which never knew the connection and answers with a stateless reset. Without the forwarding the parent's time-wait list would have re-sent the storedCONNECTION_CLOSE, which tells the peer why the connection ended.Fix: while not accepting, a packet whose destination connection ID is in the time-wait list is left to quiche (the hook returns false and the dispatcher goes on to the time-wait list as usual). Only packets for connections the dispatcher does not know at all are forwarded. The change is in the parent, so it applies from the first hot restart in which the draining process has it.
Runtime guard:
envoy.reloadable_features.quic_hot_restart_time_wait_before_forward(default true).Testing:
EnvoyQuicDispatcherTest.ProcessPacketHandlesTimeWaitConnectionLocallyWhenNotAcceptingcreates a session, closes it with aCONNECTION_CLOSEso its ID is in the time-wait list, stops accepting, and checks that a later packet for that ID is handled by the dispatcher while a packet for an unknown ID is still reported for forwarding.ProcessPacketForwardsTimeWaitConnectionWhenGuardDisabledchecks the previous behavior with the guard off.active_quic_listener_test,quic_http_integration_testandhotrestart_testpass.Observed on a deployment running HTTP/3 under load across hot restarts, as stateless resets around each restart. It was deployed there together with #47868, which fixes the larger source of those resets (the paused child listener reading the shared socket); this change has not been measured in isolation from that one, so its own share rests on the mechanism above and the unit tests.
Risk Level: low (QUIC listeners of a draining hot restart parent only; runtime guarded)
Testing: unit tests (new), QUIC listener and integration tests, hot restart integration test
Docs Changes: N/A
Release Notes: bug_fixes
Platform Specific Features: N/A
Runtime guard: envoy.reloadable_features.quic_hot_restart_time_wait_before_forward