feat(rdns): network-scoped rDNS eviction with generation-guarded inflight lookups - #80
Merged
Conversation
dweekly
force-pushed
the
feat/network-scoped-rdns
branch
2 times, most recently
from
September 3, 2026 01:44
fb9a55a to
3bdb60b
Compare
dweekly
force-pushed
the
feat/network-scoped-rdns
branch
from
September 3, 2026 01:49
3bdb60b to
65bbbda
Compare
dweekly
changed the base branch from
feat/trace-options-and-cancellation
to
main
September 4, 2026 00:00
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.
Summary
Implements phase 2 of Cache and Network-Transition Lifecycle from docs/CACHE-AND-TRANSITION-LIFECYCLE.md:
invalidateNetworkScopedRDNS(): Selectively evicts cached reverse DNS entries whose address is not globally routable (RFC 1918 private, CGNAT, link-local, loopback, IPv6 ULA). Globally routable internet hostnames and their TTLs are preserved.RDNSCachewithscopedGenerationandglobalGeneration. WheninvalidateNetworkScoped()is called, in-flight scoped lookups are discarded, while in-flight global lookups complete and cache normally. Fullclear()continues to invalidate both.invalidateNetworkScopedRDNS()resetsconsecutiveStallsso subsequent lookups are immediately attempted on the new network path.Stacked on top of #79 (
feat/trace-options-and-cancellation).Testing
CacheGenerationTests.swift:scopedEvictionPreservesGlobal: Verifies scoped entries (RFC 1918, CGNAT, link-local, loopback, ULA) are evicted while global IPv4/IPv6 entries remain cached with unchanged hit counts.scopedEvictionResetsStallBreaker: Verifies that tripped circuit breaker is reopened on scoped eviction.inFlightScopedVsGlobal: Verifies that an in-flight scoped lookup is rejected while an in-flight global lookup completes and caches.tracerScopedEviction: Verifies actor-level invocation.--warnings-as-errors; formatting checked withswift format lint --strict.