bug(worker): Task assignment ignores pendingTermination flag #223
Labels
No labels
good first issue
has-pr
help wanted
idea
priority
critical
priority
high
priority
low
priority
medium
status
blocked
status
in-progress
status
needs-review
status
ready
type
bug
type
docs
type
enhancement
type
feature
type
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
customable/claude-mem#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Workers marked with
pendingTermination = truecan still receive new task assignments, defeating the purpose of graceful termination.Current Behavior
When a worker is queued for termination via
queueTermination(), thependingTerminationflag is set totrue. However,findAvailableWorker()andfindAvailableWorkerForAny()do not check this flag before returning a worker as available.Result: A worker that completes its current task while pending termination can receive a new task instead of being terminated.
Affected Code
packages/backend/src/websocket/worker-hub.tsLine 398-408 -
findAvailableWorker():Line 413-424 -
findAvailableWorkerForAny():Expected Behavior
Workers with
pendingTermination = trueshould be excluded from task assignment and should be terminated after completing their current task.Fix
Add
!worker.pendingTerminationcheck to both methods:Impact