Skip to content

[ZEPPELIN-5235] Add Cancel all paragraphs button to the new UI - #5425

Merged
voidmatcha merged 3 commits into
apache:masterfrom
HwangRock:ZEPPELIN-5235-cancel-all
Aug 18, 2026
Merged

[ZEPPELIN-5235] Add Cancel all paragraphs button to the new UI#5425
voidmatcha merged 3 commits into
apache:masterfrom
HwangRock:ZEPPELIN-5235-cancel-all

Conversation

@HwangRock

@HwangRock HwangRock commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

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 DELETE /api/notebook/job/{noteId}, so a user who starts a long note has
to leave the page and issue a REST call, or cancel each paragraph one by one.

This adds a Cancel all paragraphs button next to run-all in the new UI. The button sends a new
CANCEL_ALL_PARAGRAPHS websocket message, and cancelAllParagraphs() in NotebookService aborts
every paragraph of the note that has not terminated yet.

The abort loop already existed inline in stopNoteJobs() in NotebookRestApi. It is extracted to
Note.abortAll() so the REST endpoint and the websocket handler share one implementation instead of
drifting apart. Permission handling follows the existing run path: the service checks
Permission.RUNNER the same way cancelParagraph() does, and the note is reached through
notebook.processNote() so the note lock is held while paragraphs are aborted.

No new cancellation mechanism is introduced. Note.abortAll() calls the existing Paragraph.abort(),
which delegates to interpreter.cancel() exactly as single-paragraph cancel does today. The button is
disabled in revision view and while no paragraph is running.

What type of PR is it?

Improvement

Todos

  • - Extract Note.abortAll() and reuse it from stopNoteJobs()
  • - Add CANCEL_ALL_PARAGRAPHS op and NotebookService.cancelAllParagraphs()
  • - Add the button to the new UI action bar and the message to the SDK
  • - Unit tests for the notebook, service and socket layers

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-5235

How should this be tested?

NotebookServiceTest covers the success path, the forbidden path for a non-runner, and an unknown
note id. NotebookServerTest covers the op routing. NotebookTest covers Note.abortAll() leaving
terminated 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:

  • Does the license files need to update? No.
  • Is there breaking changes for older versions? No. The REST behaviour is unchanged and the new op is additive.
  • Does this needs documentation? No.

@jongyoul jongyoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM for the backend part.

@voidmatcha voidmatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

One thing in the description: it says stopping a note is reachable through PUT /api/notebook/job/{noteId}, but the endpoint is @DELETE (NotebookRestApi.java:879). There is no PUT on that path.

@HwangRock

Copy link
Copy Markdown
Contributor Author

Good catch, stopNoteJobs() is @DELETE, not PUT. Fixed the description. Thanks @voidmatcha!

@voidmatcha
voidmatcha merged commit 2cc438b into apache:master Aug 18, 2026
18 checks passed
@voidmatcha

Copy link
Copy Markdown
Member

Merged into master (2cc438b).

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