Skip to content

Add built-in retries for failed automation jobs #1467

Description

@open-inspect

Context

Follow-up to #561, specifically the latest comment:

the challenge i've found with a retry mechanism (at least if applied at the actual call itself) is that the entire D1 is locked for 20-70 seconds.

i'm open to having a job level retry, which in-theory should at least be able to mitigate some of the issues

Transient infrastructure failures such as the D1 stalls described in #561 can cause automation jobs to fail even though the underlying service recovers shortly afterward. Retrying individual D1 calls is unlikely to help while the entire database remains unavailable, but retrying the automation job after a delay could allow it to recover automatically.

Proposal

Allow automation jobs to have a built-in retry mechanism when a run fails.

  • Support configuring the maximum number of retry attempts for an automation job.
  • Delay retries long enough to accommodate transient outages such as the observed 20–70 second D1 stalls.
  • Track each retry attempt and preserve the final failure state when all attempts are exhausted.
  • Avoid retrying jobs that were explicitly cancelled.
  • Ensure retries do not produce duplicate concurrent runs for the same scheduled execution.
  • Surface retry status and attempt count so users can distinguish a retrying job from a permanently failed job.

Outcome

Automation jobs can recover from transient failures without manual intervention while remaining bounded and observable.

Metadata

Metadata

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions