Learn

VISUAL GUIDE · APIS & QUEUES

When a job runs twice

Step 4 of 10: The acknowledgement never arrives

STEP 4 / 10ORIGINAL SKETCH
enqueuelease jobackdebit order 42Checkout APIJob queuelease 30 sWorker Acrashed before ackLedger DBwallets + done keys
A checkout API enqueues a charge job; worker A leases it and writes to the ledger database but its acknowledgement is lost; the queue redelivers to worker B, which writes again unless an idempotency key stops it; an external card provider can also receive the key.
4 / 10
  1. Enqueue
  2. Lease
  3. Side effect
  4. Ack lost
  5. Timeout
  6. Redelivery
  7. At-least-once
  8. Dedupe key
  9. Conditional write
  10. External effects

STEP 4 OF 10 · ACK LOST

The acknowledgement never arrives

Worker A is about to send "done with job 7" to the queue. That acknowledgement never arrives: the process is killed during a deploy just before sending it, or the network drops the message.

The ledger says the charge happened. The queue has no idea.

Why it matters. There is always a gap between doing the work and reporting it. A crash in that gap is rare per job and certain over millions of jobs.