Don't bubble up linked token cancellation to the batching work queue#61739
Merged
CyrusNajmabadi merged 11 commits intodotnet:mainfrom Jun 7, 2022
Merged
Don't bubble up linked token cancellation to the batching work queue#61739CyrusNajmabadi merged 11 commits intodotnet:mainfrom
CyrusNajmabadi merged 11 commits intodotnet:mainfrom
Conversation
dibarbet
approved these changes
Jun 7, 2022
sharwell
reviewed
Jun 7, 2022
CyrusNajmabadi
commented
Jun 7, 2022
sharwell
reviewed
Jun 7, 2022
Comment on lines
+148
to
+149
| // Make sure the task being performed doesn't propagate out a cancellation exception that isn't | ||
| // associated with the token we pass into it. |
Contributor
There was a problem hiding this comment.
Would prefer this comment be inside the catch block, with a comment that we don't want an exception thrown by a work item to break the queue.
sharwell
reviewed
Jun 7, 2022
sharwell
reviewed
Jun 7, 2022
src/Workspaces/Core/Portable/Shared/Utilities/AsyncBatchingWorkQueue`2.cs
Outdated
Show resolved
Hide resolved
sharwell
reviewed
Jun 7, 2022
src/Workspaces/Core/Portable/Shared/Utilities/AsyncBatchingWorkQueue`2.cs
Outdated
Show resolved
Hide resolved
sharwell
approved these changes
Jun 7, 2022
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.
We were bubbling out an interior cancellation operation to our async batching queue, causing it to cancel all further work. This violates the contract about how cancellation is supposed to operate (Where callers should only get cancellation on the tokens they pass into methods). This was leading to us having a race where we might cancel nested work, but end up in a canceled state forever.