deshaw / jupyterlab-execute-time

A JupyterLab extension for displaying cell timings
BSD 3-Clause "New" or "Revised" License
362 stars 48 forks source link

Cell execution timer continues even after kernel is shutdown #117

Open mbektas opened 5 months ago

mbektas commented 5 months ago

Steps to reproduce:

  1. Run a notebook cell which takes long to execute
  2. Close and reopen the notebook
  3. Notice that the timer still ticks, even if kernel is shut down after reopening.

I would expect timer to not tick after reopening the notebook.

cell execution timer

krassowski commented 5 months ago

While it is easy to solve for the case of a dead kernel, in general if kernel is still running when re-opening we would not know if any given cell has already completed execution. We are exploring something to fix that in https://github.com/jupyter-server/jupyter_server/issues/990#issuecomment-2023437146

krassowski commented 5 months ago

I looked a bit more into this and because the timer is a function of cell metadata, even a hot fix would not be trivial (unless we store kernel/session ID in the cell metadata which would be rather noisy; this way we could compare if the currently running kernel - if any - is the kernel in which the cell execution started). Again, it looks like the best solution would be adopting https://github.com/jupyter-server/jupyter_server/issues/990#issuecomment-2023437146.