Commit
Fix queue retry backoff, lock-owner guards, and hard job timeouts
Commit details
Commit notes
- FAIL_JOB now schedules retries on the delayed ZSET with the computed exponential backoff instead of re-queueing immediately (the Lua script previously discarded retryDelay — both branches were identical LPUSHes). The existing delayed-job promoter moves them back once due. - COMPLETE_JOB and FAIL_JOB verify lock ownership (mirroring EXTEND_LOCK) before mutating job state, so a stalled worker that wakes after its lock was reclaimed can no longer clobber the new owner's lock or job status. - Job handlers are raced against the abort signal: a handler that ignores the signal no longer holds its concurrency slot and heartbeat-extended lock forever — the job is failed at jobTimeout (owner-guarded). Abort reasons distinguish timeout/lock-lost from shutdown so graceful drain still lets in-flight jobs finish. - Add queue.integration.test.ts covering all three behaviors against real Redis (skips cleanly when unavailable).
[private session redacted]
- Files changed
- 2
- Lines added
- +260
- Lines removed
- −20