Skip to content

Fix for issue 1750-prevent re-execution of already running cell #7643

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SsaiSanjanna03
Copy link

@SsaiSanjanna03 SsaiSanjanna03 commented Apr 27, 2025

Fixes https://github.com/jupyter/notebook/issues/1750:Prevent concurrent cell executions in Jupyter Notebook.

Changes:

  • Updated packages/notebook/src/actions.tsx to use metadata['running'] to block execution if a cell is running, logging "Cell is already running".
  • Added UI test in ui-tests/tests/runcell.spec.ts to verify:
    • Single output for rapid cell executions.
    • Correct variable state (i == 1).
    • Console log for ignored requests.

Testing:

  • Manually verified by rapid Shift+Enter on a long-running cell.

Related:

Ready for review.

Copy link
Contributor

Binder 👈 Launch a Binder on branch SsaiSanjanna03/notebook/prevent_cell__re_execute_issue1750

@krassowski
Copy link
Member

I wonder if this should be behind an option as concurrent re-runing of a cell is sometimes intended, especially with async kernels.

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.

2 participants