Repository navigation
Fix: a failing pool task is reported again as an unhandled future (better exception stack traces) - #14595
Merged
alies-dev merged 2 commits intoNov 21, 2026
Conversation
When a task of a worker pool failed, Pool::run() reported the failure and then reported it again: the futures it derived from the task's future (task-done callback, slow-task timer, progress counter, message pump) were never observed, and destroying them raised UnhandledFutureError and UncaughtThrowable from the event loop. Keep those futures and await them with the task futures, so a failure is thrown once. When submit() throws before the await (a worker that cannot start kills the pool, and the tasks already submitted fail with it), ignore them, as the thrown error already says why. The pump's channel-closing future is ignored too: the task future awaited in run() carries the failure.
alies-dev
marked this pull request as ready for review
November 21, 2026 23:36
- Drop the submit() failure path, the ContextFactory parameter and the tests and helpers that only served it. - One test runs a failing task with a message handler and a task-done closure, so it covers the derived futures and the message pump.
Contributor
✅ Performance: unchanged · Types: unchanged
How to read this table
head 7db8059 · base 0b1d9ca (merge-base) · workflow run |
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.
When a task of a worker pool fails (for example a plugin hook throwing in a scan worker), Psalm reports the failure, then reports it again wrapped in
UnhandledFutureErrorandUncaughtThrowablefrom the event loop.Before (
--threads=2on 600 files, a plugin throwing inafterClassLikeVisitfor one class)After