Skip to content

Resuming a -permute scan skips the permutation pass (resume offset is applied to the candidate list) #107

Closed

Description

@TMHSDigital

Why it matters

Interrupting and resuming a -permute scan silently loses the entire second pass, and the target is still reported as finished. Users get fewer results and no warning.

Evidence

  • main.go:828 sets f.resumeFrom, f.resumeNames = saved.RootDone, ... for the resumed target.
  • main.go:842 passes the same f to runPermutationPass, which calls scanTarget then scanOptions (main.go:961, ResumeFrom: f.resumeFrom).
  • So the permutation scan starts at index RootDone of the candidate list (internal/scan/runner.go:553).
  • Repro: a state file with -permute, RootDone=5000 and 2 restored results prints "Permutation pass ... 166 candidates", then resolved 0, nxdomain 0.
  • Permutation progress itself is never saved either, so an interrupt during the permute pass cannot be resumed correctly.

Suggested approach

Zero resumeFrom/resumeNames on the copy of f handed to runPermutationPass. Better, record permutation-pass progress separately in the state file (e.g. PermuteDone).

Done when

E2E tests that interrupt before and during the permute pass give a resumed result set identical to an uninterrupted run (lab zone or local DNS server).

Activity

  1. added
    bug
    priority: high
    area: scan
    on Oct 6, 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: scanbugpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions