fix: race condition with error coalescing#5591
Merged
ruben-arts merged 3 commits intoprefix-dev:mainfrom Mar 3, 2026
Merged
Conversation
remove_cancellation_token now explicitly cancels the token before removing it, ensuring child tokens are also cancelled.
Add is_parent_cancelled helper method and early returns at the top of all task handlers. When a parent context has been cancelled or cleaned up, child tasks are now dropped immediately, preventing reporter_context from being called with stale parent contexts (the SlotMap panic).
Add the missing self.parent_contexts.remove(&context) call in on_source_metadata_result, matching every other result handler. fix: surface real solve errors instead of cancellation errors Filter cancellation errors from conda solve results so that when one platform solve fails, the real error surfaces instead of 'the operation was cancelled' from sibling solves that were cancelled as a consequence.
|
Thanks for the fix! I don't know enough about pixi or tokio (or rust for that matter) to know whether this is a case you need to handle. From what I understand, this change doesn't recurse up to the root when checking cancellations which could cause an issue with nested children. e.g. If child_child runs first it wouldn't detect the cancellation. |
Contributor
Author
|
The system we use propagates cancellation up and down the tree, so that should function correctly. I'll think if I can come up with a test that shows this. |
|
Great! Thank you |
ruben-arts
approved these changes
Mar 3, 2026
Contributor
ruben-arts
left a comment
There was a problem hiding this comment.
Thank you that works!
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.
Description
This PR should once and for all fix the cancellation issues that we have seen. The PR does two things:
Fixes #5588
How Has This Been Tested?
I have extensively tested this against the reproducer in #5588 where I can no longer reproduce the issue.
AI Disclosure
Tools: Claude Code
Checklist: