Unlimited Design & Technology

Reliability and Operations

Handle background jobs with visible retry boundaries

Background work needs a visible end to automatic recovery. Define retry eligibility, duplicate protection, attempt limits, and an operator decision for jobs that cannot finish safely within their useful lifetime.

UDT InsightsJul 8, 2023
A colleague routes background jobs from a queue through a retry loop to a stop boundary. A seated operator uses a laptop.

A background job should not disappear from business view just because it runs outside the customer’s request. When processing fails, someone needs to know whether the work will retry, whether its effect may already exist, and when a person must decide. Design those states before using an unlimited retry loop as a substitute for operational ownership.

Separate temporary failure from invalid work

Classify failures according to whether another attempt could reasonably succeed. A temporary dependency interruption differs from a permanently invalid document. Define a waiting state, a successful state, and a terminal state that requires review. Let support staff see the state without exposing sensitive job contents.

AWS explains that a timeout or failure does not necessarily mean side effects did not happen.[7] Therefore, an uncertain result needs more care than simply resending the job. Ask how the receiving operation recognizes repeated work and how the team reconciles an ambiguous outcome.

Give retries a useful lifetime

Set an attempt limit, an elapsed-time boundary, and a business deadline. Recommend stopping automatic retries when any applicable boundary is reached. Delaying a shipment notice until after delivery may no longer serve its original purpose, even if the infrastructure eventually recovers.

AWS describes backoff and jitter as ways to space retries and avoid synchronized bursts.[7] Backoff increases the delay between attempts. Jitter adds randomness to the timing.[7] Apply those ideas with explicit limits rather than assuming waiting alone solves overload. Record when the next attempt is due and which component controls it so that layered retries do not remain invisible.

Make the boundary visible to operators

Review the job design with the business owner who depends on the result. Ask for a test of both failure and manual resolution.

  • Define which failure classes qualify for automatic retry.
  • Set attempt, elapsed-time, and usefulness limits.
  • Document how repeated work avoids duplicate business effects.
  • Show next-attempt timing and the final unresolved state.
  • Name who may reconcile, cancel, or replay the work.

Hypothetical example: an accounting export

In this hypothetical example, a nightly export sends invoice records to an accounting connector. The connector times out after accepting a batch, leaving the sending job uncertain. The job retains a stable reference and enters reconciliation rather than automatically creating a new batch identity.

An authorized reviewer checks the connector’s result before deciding whether to retry. The example illustrates duplicate prevention and ownership. It does not claim that every external system supports the same reference scheme or guarantees exactly one business effect.

Keep manual recovery controlled

Short retry limits can move too much work into manual review. Long limits can hide problems and consume capacity after the result loses value. Choose the boundary according to the business operation, not one shared number for every queue.

Keep an audit trail when someone cancels or replays work. Require a reason and a check of possible prior effects. A queue of unresolved jobs is not a failure of automation if it represents an intentional decision boundary. It becomes a problem when nobody owns that boundary.

References

Discuss your next project

Talk with UDT about your needs and the next practical step.

Contact UDT
Zalo