Skip to content

Treat worker as busy while cleaning up canceled task#549

Open
joshkel wants to merge 1 commit intojosdejong:masterfrom
joshkel:worker-cancel-busy
Open

Treat worker as busy while cleaning up canceled task#549
joshkel wants to merge 1 commit intojosdejong:masterfrom
joshkel:worker-cancel-busy

Conversation

@joshkel
Copy link
Copy Markdown
Contributor

@joshkel joshkel commented Apr 30, 2026

In case it helps, here's a draft PR to fix #548, created with assistance from Claude Code. I'm uncertain of your AI contributions policy - feel free to close this if you wish.

Fixes #548

Tests (via Claude Code):

  • New regression test in Pool.test.js: should not assign new tasks to a worker whose previous task was cancelled.
  • Two updated tests in the abort handler group: the … dedicated worker with Timeout and … dedicated worker with Cancellation tests previously asserted busyWorkers === 0 immediately after the cancel/timeout .catch fires — i.e., during the cleanup window. The corresponding inline-worker variants of those same tests already assert busyWorkers === 1 at that point, so the dedicated-worker variants appear to have been written inconsistently. Updated them to match the inline variants. The post-pool.exec(...) assertions, which verify the worker was not replaced, are unchanged and still pass.

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.

"Worker terminated" from canceling a task

1 participant