Add --force flag to queue worker clean#492
Merged
Merged
Conversation
When a containerized worker is killed (SIGKILL, container restart) the queue_processes row survives with a recent modified timestamp. The default heartbeat-based cleanEndedProcesses() considers the row "still alive" and keeps it. The new worker, getting the same recycled PID, then crash-loops on the unique (pid, server) index. The --force flag wipes every queue_processes row in one shot so an operator can recover without manual SQL.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #492 +/- ##
============================================
- Coverage 77.62% 77.51% -0.12%
- Complexity 968 971 +3
============================================
Files 45 45
Lines 3240 3255 +15
============================================
+ Hits 2515 2523 +8
- Misses 725 732 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--force(-f) option tobin/cake queue worker cleanqueue_processesrows, bypassing the heartbeat-based thresholdmodifiedtimestamp, so the heartbeat-based cleanup won't remove it, and the unique(pid, server)index makes the new worker crash-loop.Why a flag (not auto-recovery)
This is the operator escape hatch — minimal change, opt-in, no behavioral surprise. A follow-up PR will add automatic eviction in
add()for the common case so this flag becomes rarely needed.