Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TaskQueue and SafeContinueWith extensions #76459

Merged
merged 19 commits into from
Dec 17, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Dec 17, 2024

Fixes #44150
Fixes #47891

Followup to #76455

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 17, 2024
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review December 17, 2024 20:44
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner December 17, 2024 20:44
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski @JoeRobich @sharwell @dotnet/roslyn-ide ptal.

@CyrusNajmabadi CyrusNajmabadi merged commit 71bdd3b into dotnet:main Dec 17, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 17, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the allTaskQueueRemoval branch December 17, 2024 22:02
Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small concern about the "UnlessCancelled" variant but nothing that blocks.

{
foreach (var item in list)
{
cancellationToken.ThrowIfCancellationRequested();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cancellation could change behavior here -- before Workspace events would be queued and would continue, at least until the termination of the process. If that cancellation triggers at some earlier point now it might mean people won't get events. Practically, this would only matter during shutdown, and since we were queuing to the UI thread there was already a pretty good chance those might never fire -- there's really no difference between "we cancelled them and they never ran during shutdown" versus "the UI thread was never available during shutdown to run them anyways".

This is probably a small win for shutdown perf; but if we see any strange bugs appear during shutdown this might be a place to investigate. Probably good to see if it's fine, at least!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. i'm very ok with this behavior. you dispose of the workspace, and outstanding work may not happen.

{
item();
}
catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why the "UnlessCancelled" here -- I wouldn't expect cancellation from the action since we never gave it a token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit error handling for TaskExtensions.SafeContinueWith Remove SafeContinueWith helpers
3 participants