-
Notifications
You must be signed in to change notification settings - Fork 191
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
Mark progress bars as cancellable where it appears we are respecting the token #3517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM.
Is it worth testing each of these actions to make sure they are truly cancellable (that the token passed is actually used appropriately)? Otherwise we could be giving people a cancel button that is broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure most of these should be cancellable. It would probably be better to remove the token instead.
Thanks for looking deeper into what the cancellation token actually does in these commands. I was originally hoping that because we pass it to the query server that it'll be used accordingly. I've now also dug into the code for the query server and I agree those three cases aren't actually as cancellable as they appear. Since we expect restarting the query server and trimming the cache to be pretty fast I agree we don't need to make them cancellable. It also isn't any change in behaviour from before this PR and is just cleaning up the code so it should be safe. |
I've updated the PR to only make the model editor one cancellable and for the query server ones leave them as not cancellable and clean up the code instead. I decided to remove the I've also quickly tested each of these cases manually just to make sure they work still. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This PR should fix all instances of https://github.com/github/vscode-codeql/security/code-scanning?query=is%3Aopen+branch%3Amain+rule%3Avscode-codeql%2Fprogress-not-cancellable
These are cases where the progress bar is not marked as cancellable, but we are using the token as if it were cancellable. Theoretically everything should just work if we say the progress bar is cancellable, and this gives the user more power to cancel long-running operations.
Checklist
ready-for-doc-review
label there.