Skip to content

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

Closed
SsaiSanjanna03 wants to merge 2 commits intojupyter:mainfrom
SsaiSanjanna03:prevent_cell__re_execute_issue1750
Closed

Fix for issue 1750-prevent re-execution of already running cell#7643
SsaiSanjanna03 wants to merge 2 commits intojupyter:mainfrom
SsaiSanjanna03:prevent_cell__re_execute_issue1750

Conversation

@SsaiSanjanna03
Copy link
Copy Markdown

@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.

@github-actions
Copy link
Copy Markdown
Contributor

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

@krassowski
Copy link
Copy Markdown
Member

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

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Apr 23, 2026

Closing as stale, and also because the proper place to implement such feature would be https://github.com/jupyterlab/jupyterlab, which Notebook depends on.

Please continue to the discussion in https://github.com/jupyterlab/jupyterlab or the related issue if still needed, thanks!

@jtpio jtpio closed this Apr 23, 2026
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