Ymareth
Ymareth

Reputation: 671

Jupyterlab occasionally hangs during simple execution with excessive CPU and memory consumption

This is seems to be a Heisenbug so I can't give a reproducible example but I can describe my setup and symptoms.

The symptoms are simple, occasionally (once every few days, though they seem to cluster) I will execute a simple cell in Jupyterlab, for instance even 1+1 and the kernel will stay busy, sometimes for many seconds and sometimes, like the case I'm watching right now, for 10+ minutes and shows no sign of stopping. CPU is at 100% (for that core) and memory consumption of that process is growing at approximately 1Mb/sec.

I use the jupyterlab-execute-time extension and one additional symptom of this effect is that when it occurs the running execution time footer to the lower right of the running cell, showing live execution time, does not appear during execution (I assume because the true execution time is too short for this to be shown).

If the execution does eventually cease then the final execution time is shown to the lower right of the input cell. In the case of something like 1+1 this will show as something like 10ms even though the execution took several seconds at 100% CPU.

Occasionally the execute time extension will write the total execution time below the running cell (in some cases where the actual execution time is O(10ms)) but the kernel continues to run and show busy (and the running cell marked with a *) for several seconds after (if it ever finishes).

I also use the ipywidgets plugin and I suspect this is the root of the problem though waiting for an effect to not occur isn't easy to quantify.

The setup. I am running on windows10, python 3.12.8 Jupyter running in a conda-controlled environment with...

jupyter-lsp=2.2.5=pyhd8ed1ab_1
jupyter-server-mathjax=0.2.6=pyhbbac1ac_2
jupyter_client=8.6.3=pyhd8ed1ab_1
jupyter_core=5.7.2=pyh5737063_1
jupyter_events=0.11.0=pyhd8ed1ab_0
jupyter_server=2.15.0=pyhd8ed1ab_0
jupyter_server_terminals=0.5.3=pyhd8ed1ab_1
jupyterlab=4.3.4=pyhd8ed1ab_0
jupyterlab-git=0.50.2=pyhd8ed1ab_1
jupyterlab_pygments=0.3.0=pyhd8ed1ab_2
jupyterlab_server=2.27.3=pyhd8ed1ab_1

and ipywidgets 8.1.5 in the kernel environment.

I have reinstalled both environments several times from scratch and the behaviour is persistent.

This feels like the same "kind" of issue with the variable inspector extension from some time back. But I don't have that extension installed.

Has anyone else seen similar?

Update: I believe this (often) happens when the cell in question throws an exception resulting in a stacktrace which for some reason either takes a very long time to render or enters an infinite loop.

Update: I have removed ipywidgets but still see this kind of issue. Just now 1+1 took 7 seconds to return 2. I now suspect this is some issue with pushing the result back into a large notebook. Though the kernel that is busy is the notebook kernel not the Jupyter kernel.

Upvotes: 0

Views: 54

Answers (0)

Related Questions