Skip to content

Remove aborted tasks from the skip queue - #150

Open
fbirds5230 wants to merge 1 commit into
tinylibs:mainfrom
fbirds5230:fix/149-abort-skipped-task
Open

fbirds5230 wants to merge 1 commit into
tinylibs:mainfrom
fbirds5230:fix/149-abort-skipped-task

Conversation

@fbirds5230

Copy link
Copy Markdown

Fixes #149.

An abortable task can be moved from taskQueue to skipQueue while a worker is still busy. The abort handler only removes from taskQueue, so aborting a skipped task throws and leaves it available to run later.

Remove the task from skipQueue when it is there, otherwise use the existing task queue removal path. The regression tests cover both queues with worker_threads and child_process. They keep one task pending, finish another to trigger skipping, abort the waiting task, then release the worker and check that the aborted task never ran. No timing sleeps are needed.

Validation:

  • Full suite: 102 tests passed on Node 22.18.0 with two CPUs and --maxWorkers=2.
  • Task queue suite: 12 tests passed on Node 24.22.3; the two skipped-task cases fail before the fix.
  • Build, typecheck and lint passed.

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.

Aborting a task parked in skipQueue throws and the task still runs

1 participant