Skip to content

After a budget-stop resume, excluded is doubled and processed exceeds the total #341

Closed

Description

@TMHSDigital

Summary

Since a -max-duration stop can be resumed (#294), three small report and message problems show up routinely after a resume.

Where

  • internal/scan/dispatcher.go (stopAdmitting)
  • internal/cli/resume.go (mergeStats)
  • internal/scan/runner.go (per-chunk completion reports)
  • internal/cli/session.go, internal/cli/resume.go (resume messages)

Details

  1. Excluded counted twice. stopAdmitting counts the not-yet-tested excluded candidates when the budget stops the run, and the resumed run counts them again when it reaches them; mergeStats adds both (a.Excluded += b.Excluded).
  2. Processed above the total. Workers report completions per chunk, so up to one chunk per worker is looked up again after a resume and counted twice: a lab run showed 6 processed with a resume point of 3.
  3. Wording. The resume messages still say "before the interrupt" and "interrupted run" for runs stopped by -max-duration or the reliability guard.

Impact

Only the report's excluded and processed numbers and two messages are wrong; found names and verdicts are not affected.

Suggested fix

Count excluded candidates at the stop only for those before the saved resume point (or drop the stop's count on merge); make the resume point follow completed jobs rather than chunks, or subtract re-looked-up names; reword the messages to "stopped run".

Acceptance criteria

  • A resumed -exclude run reports each excluded name once
  • processed never exceeds the candidate count after a resume
  • Resume messages do not call a budget stop an interrupt

Getting started

  • How to run tests: make test (or go test ./...). Tests must stay hermetic: use -simulate, -simulate-zone or 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: low. Effort: M. audit-key: bug|internal/cli/resume.go|mergeStats

Activity

  1. added
    bug
    area: cli
    severity: low
    on Nov 15, 2026
  2. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    Part 3 done in 30442d5: the seven user-facing resume messages say "the stopped run" / "before the run stopped" instead of "interrupted run" / "before the interrupt", so a -max-duration or guard stop is not called an interrupt. Verified: the two tests that match the text were updated; go test ./internal/cli and golangci-lint v2.15.0 pass.

    Still open:

    1. Excluded counted twice: the stopped run's excluded covers everything from its resume point onward (counted at the stop by stopAdmitting), and the resumed run counts the same range again. A correct merge needs the stopped run's excluded count up to its saved resume point (RootDone), which the engine does not report yet.
    2. Processed above the total: completions are reported per chunk, so names in a chunk that was in flight at the stop are looked up again after the resume and counted twice. Needs the resume point to follow completed jobs, or the re-tested names subtracted.
  3. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    The remaining two parts are fixed in cf034fd. The engine reports what a resume repeats (scan.Stats.Repeat: entries at or past RootDone that were looked up or excluded, and every lookup below depth 1), and the CLI takes it off a pass it saves for resuming; withoutRefound now also adjusts the resumed part's total. Verified: new TestE2EResumeCountsEachNameOnce (an -exclude run stopped by -max-duration and resumed to the end gives the uninterrupted run's processed, total, outcomes and excluded) failed before (23 excluded for 12 names) and passes 5 runs in a row; go test -race ./internal/scan ./internal/cli ./pkg/..., golangci-lint v2.15.0 and the 1M-entry benchmark pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: clibugseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions