Skip to content

Prevent re-execution of a cell that is already running #1750

Open
@henridf

Description

@henridf

If you start the second cell below and then run it multiple times (e.g. with shift+enter) while it is already running, the value of i will be equal to the number of times it was run.

# initialization cell
i = 0
# cell to run concurrently
import time
time.sleep(5)
print("done %d"  % i)
i = i + 1

We ran into this in the context of long-running spark jobs, where a user mistakenly ran an already-running (long-lived) cell, leading to errors.

It seems like an easier-to-understand behavior would be simply to ignore "run cell" commands for a cell that is already running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions