Repository navigation
Conversation
Leaving the block cancelled the Worker's run task while a plugin's run_worker still had work after shutdown, and the run task then cancelled the caller's task, so the next await outside the block raised CancelledError.
Once exit waits for the run task, a cancel of the caller reached the plugin and was swallowed, and an error from a plugin's work after the Worker stopped was dropped. Setting the exit flag before shutdown also returns an error raised as shutdown completes as itself.
moetemp
marked this pull request as draft
October 12, 2026 06:58
This was referenced Oct 13, 2026
Owner
Author
|
Closed as unused. Jetty and Bridge are frozen, and the Brook v4 stack doesn't build on this PR. The branch stays, so this PR can be reopened. |
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.
What changed?
This PR stops
Worker.__aexit__from cancelling the Worker's run task, so a plugin finishes its work and the caller isn't cancelled later.__aexit__marks that the block is being left and awaits the run task. A cancel of the caller during exit still raises. An error from a plugin's work after the Worker stopped is raised from__aexit__when the block raised nothing.Why?
Any plugin with work after the Worker stops, like a flush, lost it, and the caller's next await raised
CancelledError. The streams plugin's stop flush found it, but the bug isn't specific to streams.How did you test it?
Link to a test plan if any -
Ran the new test in
tests/test_plugins.py, plus the Worker and activity suites.