Skip to content

Exit codes: SIGTERM returns 130, no documented exit-code table, partial -dL failures indistinguishable #82

Closed

Description

@TMHSDigital

Why it matters

Schedulers, CI and wrapper scripts branch on exit codes. Container orchestrators send SIGTERM, and on Windows Go maps console close, logoff and shutdown to SIGTERM too. Getting 130 there, along with a "Ctrl+C again to force quit" hint, is wrong, and multi-target runs can't tell partial failure from total failure.

Evidence

  • main.go:474-485,532-535: SIGTERM is handled like SIGINT and returns 130 instead of 143.
  • Exit codes are inconsistent and undocumented:
    • A flag parse error returns 2 (main.go:367).
    • Semantic usage errors (missing domain, bad -format) return 1.
    • README documents only 130 (README.md:319).
  • -dL semantics are undocumented (verified at main.go:494-540):
    • A failed target doesn't stop the rest, and the run exits 1 at the end.
    • -max-queries, -rate and the reliability guard apply per target.
    • A reliability abort caused by an overloaded resolver still moves on and hits the same resolver for every remaining target.
    • JSON output has no per-target status record.

Suggested approach

  • Return 128+signum: 130 for SIGINT, 143 for SIGTERM. Only print the force-quit hint for interactive interrupts.
  • Use 2 for every usage error.
  • Consider a distinct code for partial -dL failure, e.g. 3.
  • Document the table (0/1/2/3/130/143) in README and -h.
  • Document the per-target scope of -max-queries, -rate and the guard.
  • Stop remaining targets after a reliability abort, unless -no-abort is set.
  • Print a per-target status line at the end, and add a per-target status to the summary from Machine-readable run-quality report: per-query stats, wildcard drops and a confidence verdict #70.

Done when

Exit codes are documented and covered by e2e tests, including SIGTERM on Unix.

Activity

  1. added
    bug
    priority: low
    area: cli
    on Oct 5, 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: clibugpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions