Skip to content

Remove cancel optimization for packageQuery caller - #1472

Merged
sreadingMSFT merged 1 commit into
microsoft:masterfrom
sreadingMSFT:cancelFix
Sep 16, 2021
Merged

sreadingMSFT merged 1 commit into
microsoft:masterfrom
sreadingMSFT:cancelFix

Conversation

@sreadingMSFT

@sreadingMSFT sreadingMSFT commented Sep 15, 2021 •

Copy link
Copy Markdown
Contributor

There is currently no way to remove the callbacks from the context which means the callbacks can continue to be fired after the cancel has caused the coroutine to return if the coroutine does not wait for the context to finish. This triggers a crash. In the packageManagement case, it always waits for the context to finish, but in the packageQuery case it tried to optimize that away. It would be best to eventually figure out how to bring the quicker cancel back, so I'll file a bug, but for now removing that optimization so that it no longer fails is the first priority. Cancel in the packageQuery case will now also wait until the context is finished. The operation will be marked as status == Cancelled, even though it may have still run to completion (either successfully or with an install\download failure). This is built in behavior for async operations that can't be changed, and already happens for packageManagement callers calling Cancel during the Install phase (which cannot be cancelled).

Microsoft Reviewers: Open in CodeFlow

@sreadingMSFT
sreadingMSFT requested a review from a team as a code owner September 15, 2021 19:07
@sreadingMSFT
sreadingMSFT merged commit 7fb08ff into microsoft:master Sep 16, 2021
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.

3 participants