Skip to content

[Backend] Worker queue jobs silently dropped when Redis connection is lost mid-flight #778

Description

@ekelemepraise-code

Summary

When the Redis connection is interrupted after a job has been dequeued but before it is acknowledged, the job is neither retried nor moved to the dead letter queue. It is silently dropped.

Observed Behaviour

During a Redis failover (e.g., Sentinel promotion), jobs in the PROCESSING state are lost. There is no log entry, no metric, and no alert.

Expected Behaviour

  1. All in-flight jobs should be tracked with a heartbeat/lease mechanism
  2. Jobs whose leases expire should be requeued automatically
  3. Jobs that exceed max_retries should be routed to the DLQ
  4. A worker.job.dropped metric should be emitted

Implementation Notes

Acceptance Criteria

  • Lease/heartbeat mechanism implemented for all worker job types
  • Expired leases trigger requeue within configurable window
  • DLQ routing wired for max-retry-exceeded jobs
  • worker.job.dropped metric emitted and tested

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions