Skip to content

-diff counts never-verified names as still resolving after an interrupt #151

Closed

Description

@TMHSDigital

Summary

When a -diff run is interrupted while the previous names are being re-verified, names that were never checked are reported as "still resolving". The outcomes map is missing those names, and the zero value of dns.Outcome is OutcomeFound.

Where

  • main_diff.go:152-162 (emitRemoved switches on outcomes[name])
  • internal/scan/verify.go:76-89 (feed loop breaks on ctx.Done() without recording undispatched names)
  • internal/dns/resolver.go:35-37 (OutcomeFound = iota)

Details

Verify stops feeding names when the context is cancelled, so unfed names are absent from the returned map. The caller then does:

switch outcomes[name] {
case dns.OutcomeFound:
    diffSummary.StillResolving++

A missing key yields OutcomeFound, so every unverified name is counted as still resolving and unverified stays 0.

Impact

Ctrl+C during "Checking N previous names" produces a summary that claims the remaining names resolve, which is the opposite of what is known. Monitoring consumers of the diff block get a wrong "removed" count.

Steps to reproduce

  1. Run with -diff big-previous.jsonl where many names have disappeared.
  2. Interrupt during the verification phase.
  3. Observe still_resolving covers names that were never queried.

Suggested fix

Have Verify record OutcomeCanceled for every name it did not dispatch, or have emitRemoved use v, ok := outcomes[name] and count missing names as unverified. Add a test that cancels mid-verify.

Acceptance criteria

  • Interrupted verification counts undispatched names as unverified
  • Test in internal/scan/verify_test.go or main_diff_test.go

Getting started

  • Relevant files: main_diff.go, internal/scan/verify.go
  • How to run tests: go test . ./internal/scan/
  • Related docs: docs/monitoring.md

Related: #110


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

Activity

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

    @TMHSDigital
    OwnerAuthor

    Fixed in 1e14409 on main: Verify records OutcomeCanceled for undispatched names and emitRemoved counts missing entries as unverified. Verified with: new TestVerifyCancelledMidwayReportsEveryName (-count=5), diff tests.

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