Skip to content

Resumed scans over-count found and processed for re-found names #156

Closed

Description

@TMHSDigital

Summary

A resumed scan re-resolves names that were already found before the interrupt, suppresses them from output, but still counts them, so the final report's found and processed exceed the real totals.

Where

  • main.go:757-760 (restored names are skipped in emitResult)
  • internal/scan/runner.go:819,826 (engine still increments processed/found)
  • main_resume.go:78-84 (resumePass.merge adds the saved pass's counts on top)

Details

The resume offset re-expands up to a worker pool's worth of candidates (the RootDone comment acknowledges repeats). Those repeated lookups count in the engine's stats, and merge adds the previous pass's Found, so re-found names are counted twice.

Impact

found/processed in the run report and summary are inflated by up to roughly the concurrency value per interrupt/resume cycle. Monitoring consumers comparing counts between runs see phantom growth.

Steps to reproduce

  1. Start a -simulate -hit-rate 100 scan with -resume state.json, interrupt midway.
  2. Resume and compare found to the number of unique names emitted.

Suggested fix

Count the early returns in emitResult for restored names and subtract them from the engine's Found/Processed before merge, or have the engine skip restored names entirely via the resume cursor.

Acceptance criteria

  • After interrupt and resume, found equals the number of unique names written
  • Test in main_resume_test.go using -simulate

Getting started

  • Relevant files: main_resume.go, main.go
  • How to run tests: go test .
  • Related docs: README (-resume)

Related: #109, #108


Filed by repo-audit/full-audit at 3139c44. Severity: low. Effort: S. audit-key: bug|main_resume.go|resumePass.merge

Activity

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

    @TMHSDigital
    OwnerAuthor

    Fixed in d9dde29 on main: Re-found restored names are dropped from the resumed pass's found/processed before merging. Verified with: new TestE2EResumeCountsRefoundNamesOnce (25 vs 20 before the fix).

  3. added a commit that references this issue on Nov 9, 2026
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