Skip to content

cid: improve DCID retirement handling#2517

Merged
LPardue merged 1 commit into
masterfrom
dcid-retire-partition
Jun 25, 2026
Merged

cid: improve DCID retirement handling#2517
LPardue merged 1 commit into
masterfrom
dcid-retire-partition

Conversation

@LPardue

@LPardue LPardue commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The dcids ConnectionIdVecDeque is not guaranteed to be sorted, so
plainly applying self.dcids.inner.partition_point(...) can lead to
incorrect result. While we could introduce such a guarantee, it would
require spending more cycles when handling out-of-order sequence numbers.

Instead, this change checks all elements in O(n) time. While it is
possible to optimize further to take advantage of an already-sorted
list, the list is expected to be short. The additional complexity was
determined to unnecessary at this time.

This also fixes a bug where path IDs were not added to
retired_path_ids after retired.insert() returned an error.

@LPardue LPardue requested a review from a team as a code owner June 24, 2026 17:41

@dineshadhi dineshadhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ghedo

ghedo commented Jun 25, 2026

Copy link
Copy Markdown
Member

Nit: quiche: ... -> cid: ... in the commit message :)

The `dcids` ConnectionIdVecDeque is not guaranteed to be sorted, so
plainly applying `self.dcids.inner.partition_point(...)` can lead to
incorrect result. While we could introduce such a guarantee, it would
require spending more cycles when handling out-of-order sequence numbers.

Instead, this change checks all elements in O(n) time. While it is
possible to optimize further to take advantage of an already-sorted
list, the list is expected to be short. The additional complexity was
determined to unnecessary at this time.

This also fixes a bug where path IDs were not added to
`retired_path_ids` after `retired.insert()` returned an error.
@LPardue LPardue force-pushed the dcid-retire-partition branch from 41d5541 to 5a70b58 Compare June 25, 2026 16:56
@LPardue LPardue changed the title quiche: improve DCID retirement handling dcid: improve DCID retirement handling Jun 25, 2026
@LPardue LPardue changed the title dcid: improve DCID retirement handling cid: improve DCID retirement handling Jun 25, 2026
@LPardue LPardue merged commit bb98a2f into master Jun 25, 2026
38 checks passed
@LPardue LPardue deleted the dcid-retire-partition branch June 25, 2026 23:04
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.

5 participants