Skip to content

Complete hunt-job lifecycle with leases, retries, cancellation, and dead letters #36

Description

@haasonsaas

Context

The hunt_job table currently records enqueue and claim metadata and is described as supporting multi-worker claim in a later step. Retro-hunting needs operational controls when a worker crashes, a rule is invalid, or a tenant cancels a long-running job.

Proposal

Implement an explicit hunt-job state machine with lease expiry, heartbeat/renewal, retry budget, backoff, cancellation, terminal failure, dead-letter reason, and progress counters.

Acceptance criteria

  • A crashed worker's job becomes claimable after a bounded lease timeout.
  • Retries and terminal failures are idempotent and queryable.
  • Cancellation prevents new work and reports already-processed results.
  • The API/CLI exposes progress, last error, claimed worker, and retry state.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions