Skip to content

cid: don't fail when re-queuing an already queued DCID retirement - #2919

Open
xhon-pelushi wants to merge 1 commit into
cloudflare:masterfrom
xhon-pelushi:fix-2906-retire-dcid-reenqueue
Open

xhon-pelushi wants to merge 1 commit into
cloudflare:masterfrom
xhon-pelushi:fix-2906-retire-dcid-reenqueue

Conversation

@xhon-pelushi

Copy link
Copy Markdown

Fixes #2906.

BoundedConnectionIdSeqSet::insert() checks the capacity before checking whether the sequence number is already in the set. So once the retired DCID set is full, queuing a RETIRE_CONNECTION_ID for a sequence number that is already pending returns IdLimit, and from the lost-frame path in send_single() that error closes the connection. The seq is normally removed from the set when the frame is sent, so this needs the same seq to be queued again in the meantime (for example by a retransmitted NEW_CONNECTION_ID below the current Retire Prior To) while the set is at capacity.

Inserting an existing element doesn't grow the set, so insert() now returns early in that case. New sequence numbers still hit the limit as before.

Added cid::tests::retire_dcid_seq_already_queued_when_full, which fails on master with Err(IdLimit) and passes with the change.

Tested with cargo test -p quiche --lib (1283 passed).

BoundedConnectionIdSeqSet::insert() checked the capacity before looking
at whether the sequence number was already in the set, so queuing a
RETIRE_CONNECTION_ID for a sequence that is already pending returned
IdLimit once the set was full, and that error closes the connection
(e.g. from the lost-frame path in send_single()).

Inserting an existing element doesn't grow the set, so return early
in that case.

Fixes cloudflare#2906.
@xhon-pelushi
xhon-pelushi requested a review from a team as a code owner November 30, 2026 01:04

This branch has not been deployed

No deployments
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.

RETIRE_CONNECTION_ID re-enqueue on full bounded set closes connection instead of checking for existing entry

1 participant