Skip to content

Stop worker processes even when finalization rethrows a task failure - #160

Draft
giordano wants to merge 3 commits into
mainfrom
mg/stop-serial-worker
Draft

Stop worker processes even when finalization rethrows a task failure#160
giordano wants to merge 3 commits into
mainfrom
mg/stop-serial-worker

Conversation

@giordano

@giordano giordano commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Finalization waited on the printer task and the worker tasks — rethrowing
any non-interrupt failure (e.g. a throwing `test_worker` hook) — before
stopping the workers left in the pool, so a propagated failure leaked live
worker processes for the rest of the parent session. A failure during a
serial phase additionally stranded the shared serial worker in its Ref,
which even the pool cleanup would have missed, since returning it to the
pool is skipped when the phase's `@sync` throws.

Run the worker cleanup in a `finally` block and also stop a stranded
serial worker there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@giordano

giordano commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

#158 and #159 were relatively simple and hopefully uncontroversial, this one is more convoluted and probably warrants a more careful review (ignoring whitespace changes helps). At least I verified that the newly added tests fail on main, without the corresponding source code fix.

@giordano
giordano marked this pull request as draft August 8, 2026 23:59
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.

1 participant