feat: wire-level forwarding, cache, and request hedging #85
Reference in New Issue
Block a user
Delete Branch "feat/wire-forwarding-hedging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Wire-level forwarding & cache
forward_query_raw/forward_with_failover_rawskip DnsPacket parse/serialize, passing raw bytes through to upstreamRequest hedging
hedge_msin[upstream]. Set to0to disable. Inspired by The Tail at Scale (Dean & Barroso, 2013)Serve-stale & prefetch (RFC 8767)
Fresh/NearExpiry/Stalereplaces bare bool at all call sitesrefreshingguard prevents multiple concurrent refreshes for the same domainOther
refresh_entryunification: single function for cache warming and stale refresh (was duplicated).to_vec()of raw wire on every query/blocking/statsinstead of fixedsleep 4UDP_DISABLEDglobal state interferenceBenchmark suite
--vs-unbound: cached query comparison (both at 0.1ms median)--vs-unbound-cold: genuine cold recursive (1 round, PID-prefixed unique subdomains)--vs-nextdns: local cache vs cloud resolver (47x faster median)Performance
Test plan
cargo test)lookup_wire_signals_stale_when_expired,lookup_wire_signals_prefetch_near_expirycache_max_entries_evicts_stalestUDP_STATE_LOCK