All problems

Notification Worker ACKs Jobs Before Delivery Completes

Level 2 · node · Reliability · Async job acknowledgement ordering error

Scenario

A notification worker reads jobs from a queue, sends them through a provider, and ACKs successfully delivered jobs. Normal delivery appears fine, but operations reports that when the provider fails asynchronously, the queue still removes the job as completed and it is never retried. The queue, worker, and provider are separate, and unfinished failed jobs must be available on the next run.

Requirements

- ACK a job only after provider delivery succeeds - If the provider fails, do not ACK the job and leave it pending - A failed job can be processed again on the next worker run - A successfully ACKed job is not delivered again on a later run - Failure of one job does not prevent later jobs from being processed

Acceptance criteria

  • One successful notification is delivered once and ACKed
  • A failed delivery is not ACKed and remains pending
  • After recovery, the failed notification is delivered on the next run
  • An already successful and ACKed notification is not delivered again
  • A later deliverable job is sent and ACKed even when an earlier job fails