Repository navigation
Skip the strike register's full sweep while its queue is in expiry order - #220
Merged
Merged
Conversation
With the engine's uniform window the order queue is always sorted by expiry, so once the front has been pruned nothing lapsed can remain behind a live entry. The register still ran an O(capacity) sweep under the lock each time it came back to capacity after a front expiry, which contradicted its own comment. Track the newest expiry and whether the queue is still sorted, and sweep only when it is not. Compaction and an emptied queue restore the flag. Differing windows still sweep as before, and a test now covers the sweep after compaction.
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.
With the engine's uniform window the strike register's order queue is always sorted by expiry, so after the front is pruned nothing lapsed can sit behind a live entry. It still ran an O(capacity) sweep under the lock each time it came back to capacity after a front expiry, contradicting its own comment, so a client holding a ticket could make every admission at capacity pay for a full dictionary walk.
It now tracks the newest expiry and whether the queue is still sorted, and sweeps only when it is not. Compaction and an emptied queue restore the flag; differing windows sweep as before. The new assertion in the compaction test fails if compaction reports the queue sorted when a lapsed entry sits behind a live one.
I also looked into the audit's claim that a TLS 1.2 stateful ticket is used up at ClientHello. The 1.2 server builds its ticket strategy without a store, so its ticket handling is stateless and consuming one is a no-op, and the session-id path only peeks; rustls (stateless ticketer,
store.get) and OpenSSL (single-use removal only in the TLS 1.3 PSK path) behave the same, so nothing changes there. FPC x64 and i386 1427/0, Delphi Win32 build clean.