Repository navigation
Description
Summary
Each run spends its -max-duration budget on the preflight and wildcard probes before the first wordlist name, and a resumed run pays for them again, so with a low -rate and a short budget a run can test no names at all, and resuming it repeats that forever.
Where
internal/scan/runner.go(preflight and wildcard probes run before the dispatcher, under the same deadline)internal/cli/lab_test.go(TestE2EMaxDuration)
Details
Since #294 a run stopped by -max-duration saves its state and prints continue with: subenum -resume. The deadline covers the whole run, including the probes made before any candidate is tested. With -rate 10 -max-duration 1s on lab 1, 0 of 30 words were tested ("skipped 30 additional jobs"), and each -resume starts the same probes again under a fresh 1 s budget. TestE2EMaxDuration passes with zero names tested, so nothing catches it.
Impact
A scheduled job that resumes with a small time budget loops without ever finishing the wordlist. Larger budgets are only slowed, not stuck.
Steps to reproduce
subenum -rate 10 -max-duration 1s -w examples/labs/words.txt -simulate-zone examples/labs/lab1-first-scan.zone -state s.json lab.examplesubenum -resume s.json(repeat): the resume point does not advance.
Suggested fix
Either start the -max-duration clock after the pre-scan probes, or let a resumed run reuse the saved wildcard verdict instead of probing again (the state already records the target), and warn when the budget ran out before any candidate was tested. Make TestE2EMaxDuration require at least one tested name.
Acceptance criteria
- A resumed run with a small budget advances its resume point
- A run whose budget ran out before any candidate says so
-
TestE2EMaxDurationfails when no name was tested
Getting started
- How to run tests:
make test(orgo test ./...). Tests must stay hermetic: use-simulate,-simulate-zoneor the local DNS test server, never a live domain. - Related docs:
docs/DEVELOPER_GUIDE.md,docs/ARCHITECTURE.md
Filed by repo-audit/fix-issues at 637a950. Severity: medium. Effort: M. audit-key: bug|internal/scan/runner.go|maxDurationPreflight
Activity
TMHSDigital commentedon Nov 15, 2026
Fixed in 96a04d5:
scan.Runmoves the-max-durationdeadline forward by the time the preflight and wildcard probes took (unless the budget was already spent when the target started), and the time-budget notice says when no name was tested. Verified:TestE2EMaxDurationfailed before the change (0 of 30 names tested) and now requires names tested on the first run and fewer skipped on a-resume; full build, vet, golangci-lint v2.15.0 andgo test ./...pass.Don't spend -max-duration on pre-scan probes (TMHSDigital#340)
Stop handing out rate slots past -max-duration (#460)