Skip to content

fix(backend): add worker_id fencing to stalled job recovery - #1196

Open
williamsokperez-arch wants to merge 1 commit into
StellerCraft:mainfrom
williamsokperez-arch:fix/job-queue-stalled-recovery-vs-slow-completion-race
Open

fix(backend): add worker_id fencing to stalled job recovery#1196
williamsokperez-arch wants to merge 1 commit into
StellerCraft:mainfrom
williamsokperez-arch:fix/job-queue-stalled-recovery-vs-slow-completion-race

Conversation

@williamsokperez-arch

Copy link
Copy Markdown
Contributor

Coordinate recoverStalledJobs with _executeJob's fencing logic by only resetting a stalled job if its worker_id still matches the original claim. This prevents the race where recovery fires concurrently with a slow-but-still- running handler's completion write, which would otherwise leave the job in an inconsistent state (pending with incremented attempts but never retried).

closes #1149

Coordinate recoverStalledJobs with _executeJob's fencing logic by only
resetting a stalled job if its worker_id still matches the original claim.
This prevents the race where recovery fires concurrently with a slow-but-still-
running handler's completion write, which would otherwise leave the job in
an inconsistent state (pending with incremented attempts but never retried).

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@williamsokperez-arch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reproduce and Guard Against the JobQueueService Fencing Interleaving With Stalled-Job Recovery

1 participant