[ZEPPELIN-5235] Add Cancel all paragraphs button to the new UI - #5425
Open
HwangRock wants to merge 3 commits into
Open
[ZEPPELIN-5235] Add Cancel all paragraphs button to the new UI#5425HwangRock wants to merge 3 commits into
HwangRock wants to merge 3 commits into
Conversation
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.
What is this PR for?
The note action bar has a run-all button but no way to stop a note from the UI. Stopping a running
note is only reachable through
PUT /api/notebook/job/{noteId}, so a user who starts a long note hasto leave the page and issue a REST call, or cancel each paragraph one by one.
This adds a
Cancel all paragraphsbutton next to run-all in the new UI. The button sends a newCANCEL_ALL_PARAGRAPHSwebsocket message, andcancelAllParagraphs()inNotebookServiceabortsevery paragraph of the note that has not terminated yet.
The abort loop already existed inline in
stopNoteJobs()inNotebookRestApi. It is extracted toNote.abortAll()so the REST endpoint and the websocket handler share one implementation instead ofdrifting apart. Permission handling follows the existing run path: the service checks
Permission.RUNNERthe same waycancelParagraph()does, and the note is reached throughnotebook.processNote()so the note lock is held while paragraphs are aborted.No new cancellation mechanism is introduced.
Note.abortAll()calls the existingParagraph.abort(),which delegates to
interpreter.cancel()exactly as single-paragraph cancel does today. The button isdisabled in revision view and while no paragraph is running.
What type of PR is it?
Improvement
Todos
Note.abortAll()and reuse it fromstopNoteJobs()CANCEL_ALL_PARAGRAPHSop andNotebookService.cancelAllParagraphs()What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-5235
How should this be tested?
NotebookServiceTestcovers the success path, the forbidden path for a non-runner, and an unknownnote id.
NotebookServerTestcovers the op routing.NotebookTestcoversNote.abortAll()leavingterminated paragraphs alone.
Manually: create a note with six python paragraphs where the first two finish within a few seconds and
the rest sleep for minutes, run all, then press the button while a paragraph is running. The running
paragraph moves to ABORT, the finished ones keep FINISHED, and paragraphs that never started stay
untouched.
Screenshots (if appropriate)
2026-08-15.7.51.13.mov
Questions: