Repository navigation
Closed
Labels
area: scanScan engine / dispatcherenhancementNew feature or requestseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost
Description
Summary
When more than 20% of lookups fail, the reliability guard either aborts the scan (exit 1) or, with -no-abort, keeps going at the same speed and only warns. Its own message says the likely cause is rate-limiting at the current concurrency and rate, but it never acts on that. An opt-in "back off and continue" mode would turn many aborted runs into complete ones.
Where
internal/scan/runner.go:817-841(checkReliability): one-shotguardOnce; abort or warn, nothing in betweeninternal/scan/runner.go:20-21: fixedreliabilityMinJobs = 200,reliabilityFailPercent = 20internal/dns/ratelimit.go:22(NewRateLimiter): rate fixed at construction
Proposal
- Add
-auto-rate(opt-in at first). When the failure rate over a sliding window (e.g. the last 200 lookups) passes the threshold, halve the effective rate (starting from the observed qps if-rateis 0), log a notice, and keep going. Once the window is healthy again, raise it step by step up to the configured cap. - Let
RateLimiterchange its rate safely while running (SetRate). - The guard aborts only after N back-offs fail to bring the window under the threshold, or below a floor rate.
- Report back-offs and the final rate in
-statsand the summary.
Who benefits
Users on public resolvers or home networks, CI monitoring jobs (fewer flaky exit-1 runs), and people who don't know what -rate to choose.
Trade-offs / open questions
- Should failed names from the bad window be re-queued? (Pairs well with an inconclusive-names retry pass.)
- Sliding-window state should stay lock-free on the hot path.
- With
-r, back off per resolver (-rate-per-resolver) before the global rate?
Acceptance criteria
-
RateLimitersupports changing its rate while running, with tests -
-auto-ratebacks off and recovers in ainternal/dnstestscenario with injected timeouts - Default behavior unchanged without the flag
- Back-offs reported in
-statsand the summary; docs and CHANGELOG updated
Getting started
- Relevant files:
internal/scan/runner.go,internal/dns/ratelimit.go,internal/scan/verdict.go - Tests:
go test ./...(avoid wall-clock upper bounds, see Three tests still assert wall-clock upper bounds and can flake under load #206)
Filed by repo-audit/feature-ideas at 3fd0128. Severity: medium. Effort: L. audit-key: enhancement|internal/scan/runner.go|checkReliability
Metadata
Metadata
Assignees
Labels
area: scanScan engine / dispatcherenhancementNew feature or requestseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost
Activity
TMHSDigital commentedon Nov 11, 2026
Fixed in 41b2434.
-auto-rate(Config.AutoRate) judges the last 200 lookups.-rateis 0) and emits aratenotice.RateLimitergainsSetRate/Rate. The report gainsrate_backoffsandfinal_rate.-retry-inconclusive(Timed-out and refused names are dropped; record them and offer a retry pass #217).-ris not done. The controller adjusts the global rate.Verified with:
TestAutoRateBacksOffAndRecovers,TestAutoRateGivesUp,TestAutoRateUnlimitedStart)TestSetRateTestRunAutoRateKeepsGoing: the same burst of timeouts aborts a plain scan, while the AutoRate scan finishes with back-offs counted. It ran 5 times under-racewith no wall-clock upper bounds.go test ./...,-race, andgolangci-lint run(0 issues)docs(architecture): describe the engine as it is on main (#228)