Repository navigation
Description
Summary
A dead -r pool member is benched only after 20 lookups in its window with more than half failed. The bench lasts a fixed 30 s with no backoff, and every lookup on an untrusted member is preceded by a canary that does not count toward benching. Each dead member keeps absorbing about 20 double timeouts every 30 s.
Where
internal/dns/pool.go:16-19(poolHealthMinLookups = 20,poolBenchFor = 30s)internal/dns/pool.go:357-375(report)internal/dns/pool.go:414-416(checkCanary: due on every lookup while!m.trusted; failures change nothing)internal/dns/pool.go:517(Probe, used only by-dry-run,internal/cli/dryrun.go:155)
Details
A member that never answers never passes a canary, so it stays untrusted and gets a canary before each lookup. Canary failures are not passed to report. After 30 s the member returns with an empty window and must fail 20 more times. There is no consecutive-failure shortcut.
Impact
Public resolver lists often have many dead entries. Each dead member costs about 20 x (canary timeout + lookup timeout), about 40 worker-seconds per 30 s cycle at the default 1000 ms timeout. With hundreds of dead members, dead members re-enter faster than they are benched and throughput falls to roughly the live members' share. With the default -attempts 1, each pick of a dead member is also a failed candidate, which counts toward the 20% reliability guard.
Steps to reproduce
-rwith, for example, 50 live and 200 non-responding local addresses (a UDP listener that drops queries), against the lab server,-attempts 3.- Watch the per-resolver stats from
-v: dead members keep collecting lookups and failures every 30 s cycle, and queries per second stay far below a 50-member-only list.
Suggested fix
- Bench on consecutive failures (for example 3 in a row) without waiting for a window of 20.
- Double the bench time on each repeat bench (30 s, 60 s, 120 s, up to a cap).
- Count a failed canary as a failure in
report. - Optionally run
Pool.Probeonce before the scan and drop non-responders from rotation, logging how many.
Acceptance criteria
- A pool test with a never-answering member benches it within a few lookups.
- Repeat benches back off.
- Throughput with a mostly-dead pool is close to the live-only pool's.
Getting started
- Relevant files:
internal/dns/pool.go,internal/dns/pool_logic_test.go - How to run tests:
go test ./internal/dns
Filed by repo-audit/full-audit at a45b999. Severity: medium. Effort: M. audit-key: performance|internal/dns/pool.go|Pool.report
Activity