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
Jupyter Lab stalls when choosing "Restart Kernel and Run All Cells..." #9008
Comments
I'm having the same issue here.
I'm having this issue most reliably with the clojupyter (clojure) kernel, but sometime I can get the same problem with the python kernel. Note: Running restart kernel from the Kernel menu and Run all cells from the Run menu work as intented. |
Yes, I confirm the same behavior as @nighcoder. All cells are run when specified to run from the "Run" menu, but not from the "Kernel" menu. When selecting "Restart Kernel and Run All Cells", the cells are marked with an asterisk and the kernel remains idle. |
I confirm this behaviour for JL 2.2.8, too. As reported "shutting down" the kernel forcefully from the I run a modified r-notebook-stack as a docker container on Kubernetes. |
Same issue, though to be clear it doesn't hang the kernel - it just appears to. At any point I can select Run -> Run all Cells and it works as expected. It seems as if it gets as far as restarting the kernel and preparing the UI for a run all cells operation, then just forgets to do it. |
@karlaspuldaro Note sure if this issue is fixed, but I think it should be backported as mentioned in #9160. |
@phish108 2.2.9 release has been already published. I don't see a PR for this issue but once it's fixed, the backport can go in another patch release. |
I also have this problem using IRKernel and Jupyterlab 2.2.9, but with not IPython (IRkernel/IRkernel#671). I can confirm that the problem is with "Restart and run all" specifically, because "Restart kernel" then "Run All" separately is OK.
|
We are looking into this now with @JohanMabille @jtpio and @martinRenou. |
xref jupyter/jupyter_client#593 for more info |
In investigating jupyter/jupyter_client#593 I'm fairly confident that there is something amiss in the restart & run all logic in JLab 3.0rc13. On restart & run all, after the websocket connection is re-established, JupyterLab sends no messages at all. A manual click restart, then click run all works just fine. It seems like it's waiting for a condition that's never met before starting the "& run all" part. Adding debug logging to the zmq handler shows that jupyterlab is not sending the requests after restart at all. So the server-side pub/sub issue we are working on over there doesn't seem to be the only issue, at least. pip freeze
|
I tracked this down to the separate tracking of 'restarting' and connectionStatus here: jupyterlab/packages/services/src/kernel/default.ts Lines 386 to 387 in b9511a5
jupyterlab/packages/services/src/kernel/default.ts Lines 1258 to 1262 in b9511a5
but that does nothing if the jupyterlab/packages/services/src/kernel/default.ts Lines 1053 to 1060 in b9511a5
so I think there are two problems:
I think this should be fixed with two changes:
I believe the right logic is there to send a kernelInfoRequest on completed connection, but this must be actually sent, not added to the pending queue, which is what happens now. |
@minrk is this the same logic as in 2.2.x releases? |
I'm not sure, but I don't think so. I have never been able to reproduce the issue with 2.2.9, but I can 100% of the time with 3.0rc13. |
I can reproduce this issue all the time with 2.2.8 and 2.2.9. (See my message above) |
#9484 fixes the issue for me with jlab 3.0. I don't know what to say about 2.x, other than I cannot reproduce it except with 3.0 |
For reference, the restarting status sentinel for the kernel session id was added in #8562 |
Description
I recently needed to do a full reinstall of Jupyter Lab on MacOS 10.15. I use Homebrew as my package manager, running Python 3.8.5.
Jupyter Lab installed correctly, as did the R kernel (which I use frequently). However, I noticed that whenever I choose the "Restart Kernel and Run All Cells..." option, the individual notebook within Jupyter Lab stalls until I restart the kernel. Manually selecting and running all cells runs the code without any errors or stalling.
Reproduce
I tried running the same notebook file by launching a classic Jupyter Notebook from Jupyter Lab, and the "Restart Kernel and Run All Cells..." option worked perfectly.
Expected behavior
I expected Jupyter Lab to restart the kernel and run all cells without any lag.
Context
MacOS 10.15.2
Python 3.8.5 (installed via HomeBrew)
Chrome Version 84.0.4147.135
Output of
jupyter --version
:When I run
jupyter lab --debug
and attempt the "Restart Kernel and Run All Cells...", the output continuously prints:Accepting token-authenticated connection from ::1
and a variation of either200 GET /api/sessions?1600160701879 (::1) 1.71ms
,200 GET /api/kernels?1600160731926 (::1) 0.89ms
, or200 GET /api/terminals?1600160759346 (::1) 1.16ms
.I attempted to solve the issue by running
pip3 install --upgrade ipykernel
per this issue, but it did not solve the problem.Any help would be appreciated, and thanks!
The text was updated successfully, but these errors were encountered: