Treat worker as busy while cleaning up canceled task#549
Open
joshkel wants to merge 1 commit into
Open
Conversation
Owner
|
Thanks Josh I hope to look into it next week. |
joshLong145
reviewed
May 9, 2026
Comment on lines
+714
to
+719
| pool.exec(add, [3, 4]) | ||
| .then(function (result) { | ||
| assert.strictEqual(result, 7); | ||
| done(); | ||
| }) | ||
| .catch(done); |
Contributor
There was a problem hiding this comment.
question: are we confident we are not just hitting the catch block and cleaning up? I think there's potential to swallow errors.
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.
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):
Pool.test.js:should not assign new tasks to a worker whose previous task was cancelled.abort handlergroup: the… dedicated worker with Timeoutand… dedicated worker with Cancellationtests previously assertedbusyWorkers === 0immediately after the cancel/timeout.catchfires — i.e., during the cleanup window. The corresponding inline-worker variants of those same tests already assertbusyWorkers === 1at 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.