-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Add support for multiple cancellations in Notebook stop
button
#99203
Comments
stop
button
Is the interrupt also "per cell" or a global interrupt? |
This also ties into another issue where I suggested a "cancel" method instead of the token so it can live independently of the "executeCell" method |
In the case of Jupyter kernel, its a global interrupt. |
Does it make sense to still have the cancel button on each running cell, or would it be better to not have it on the cell and only have a global cancel action in the toolbar? |
I think it makes sense to have a cancel button on each running cell. Also, in the case of Jupyter we have a single cancellation for all executing cells. However in other contexts (another implementation) its possible each cell can run in parallel. E.g. if we have a polyglot solution or something like an SQL query, each cell could be completely independent of one another. Hence in such cases I'd like the cancel per cell, as its upto extension authors to handle cancellation. |
Sounds good to me, thanks for the feedback |
Hey @DonJayamanne do you still feel that this is ok?
Also I was wondering, what sort of response do you get when you send the interrupt (eg a user clicks the "cancel" button)? Or is this documented somewhere? eg does the response tell you whether the running cell has stopped executing, or how do you determine whether it was "successful"? Or in other words, whether in vscode you should take the cell out of the "running" state. Also, in Jupyter what is the difference between running a notebook vs running a single cell? If the user clicks the "run notebook" button, do you instruct the kernel to execute cells one by one? And will cancellation work any different in that case? I am wondering whether we need a notebook-level execution state to match the cell-level execution state, since right now our model provides total flexibility. Another solution would be to just get rid of the notebook-level cancellation button. We could have a quick call to discuss if that would be easier for you, sorry for throwing a pile of questions at you. |
We don't get a response indicating it was interrupted.
We run one cell at a time. Cancellation here is still the same.
I just treat the notebook level and cell level cancellations as a trigger to cancel current execution. So having this at a notebook level IMHO is good. I.e. I'd like this to continue to exist.
Anything works for me. No worries, please feel free to ping me on teams. |
Notes from our call:
|
When user runs a notebook/cell, the cancel button can be clicked once.
This cancels the
CancellationToken
passed into theNotebookKernel.executeCell
.In Jupyter, clicking
interrupt
(stop button) doesn't necessarily work the first time the button is clicked. hence one can click theinterrupt
button multiple times.We'd like the same behavior.
I.e. clicking the
cancel
button should trigger a cancellation (either the cancellation token or a cancellation callback).It is my understanding that cancellation tokens will not trigger the
onCancellationRequested
event more than once. Hence the suggestion for a callback or we create a new construct that supports such a notification.Note: Today we
Python extension
have a dedicated interrupt button on the toolbar that can be used to interrupt/stop the kernel at any point. We were planning on using the VS Codestop
icon, however it doesn't trigger callbacks when clicked more than once.@rebornix /cc
The text was updated successfully, but these errors were encountered: