Skip to content

Release DNS cache iterators before expired-entry removal - #420

Merged
j-mendez merged 1 commit into
mainfrom
harness/20261018-093857-f3a31201/author-codex-f5eb8d01e4ec
Oct 18, 2026
Merged

j-mendez merged 1 commit into
mainfrom
harness/20261018-093857-f3a31201/author-codex-f5eb8d01e4ec

Conversation

@j-mendez

Copy link
Copy Markdown
Member

Expired-entry eviction could deterministically deadlock HostDnsCache and ChromeNxdomainCache when a new host exceeded capacity. Dropping the yielded entry left the DashMap iterator’s shard read guard alive while removal waited for that same shard’s write lock.

Select an owned victim key, exit the iterator scope, then remove. Preserve expired-first eviction, oldest fallback, TTLs, and concurrent capacity behavior.

Validation: 21 targeted cache tests passed, including bounded-progress regressions for expired overflow, zero TTL/capacity one, oldest fallback, and concurrent overflow in both caches. Independent Claude review approved. Tests use the actual caches without DNS, browsers, or live sites.

Expired-entry eviction could deterministically deadlock HostDnsCache and ChromeNxdomainCache when a new host exceeded capacity. Dropping the yielded entry left the DashMap iterator’s shard read guard alive while removal waited for that same shard’s write lock.

Select an owned victim key, exit the iterator scope, then remove. Preserve expired-first eviction, oldest fallback, TTLs, and concurrent capacity behavior.

Validation: 21 targeted cache tests passed, including bounded-progress regressions for expired overflow, zero TTL/capacity one, oldest fallback, and concurrent overflow in both caches. Independent Claude review approved. Tests use the actual caches without DNS, browsers, or live sites.
@j-mendez
j-mendez merged commit 098a36a into main Oct 18, 2026
5 of 7 checks passed
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.

1 participant