Open wstomv opened 5 years ago
Although off by default, you might want to make sure you don't have culling enabled since your description fits that scenario. Culling gets enabled by a non-zero timeout value:
--MappingKernelManager.cull_idle_timeout=<Int>
Default: 0
Timeout (in seconds) after which a kernel is considered idle and ready to be
culled. Values of 0 or lower disable culling. Very short timeouts may result
in kernels being culled for users with poor network connections.
either on the command line or corresponding config file.
If culling is in play, a warning message will be logged at the time the idle kernel is culled - similar to the following (which was configured with a 600 second timeout and 30 second interval):
[W 22:34:19.612 NotebookApp] Culling 'idle' kernel 'python_delayed' (558677e7-fed2-42fe-b300-0dacd4b3c607) with 2 connections due to 624 seconds of inactivity.
There is no mention of Culling
in any of the output for NotebookApp
that I have accumulated over several days.
I find the Exception that is raised when restarting the kernel suspicious (see traceback above). But I cannot interpret that message. It involves handlers.py
and kernelmanager.py
.
Also: I cannot close such a notebook for which the kernel disappeared. It just ignores the close. (And that probably relates to the Session not found
messages that I see in the log.)
Thanks for checking. Yeah, the notebook server believes the session is now stale and closes it.
If prior log statements aren't "interesting", it might be helpful to enable debug (--debug
) and reproduce it. Based on the code comment, it sounds like there was a lost network connection on the client side, but I'm not familiar with the session-to-kernel relationship.
The kernel restart failure is purely due to the kernelmanager no longer having a record of the kernel in its active list - which led me down the culling path. This could also happen if the kernel was shutdown, or you're now targeting a different notebook server (unlikely - especially since it had a record of your session).
Sorry I can't be more helpful at this point. Perhaps someone else has ideas?
This issue does not arise when using JupyterLab (0.35.4; server: 0.2.0): an overnight edit session survived.
That's interesting since they both share the same "server" code. And you found this to be 100% reproducible via Notebook 5.7.4?
Problem keeps recurring with Jupyter Notebook, but not with JupyterLab.
However, I did now notice that after a while my notebooks under Jupyter Notebook lose trust (showing not trusted
). When clicking this to regain trust, the page reloads, and the kernel seems to behave properly again.
That is probably expected behavior of the kernel when a notebook is not/no longer trusted. Question, of course, is then: why does this happen?
Another thing that seems to help is reloading the browser page with the open notebook.
I run Jupyter Notebook 5.7.4 and IPython kernel 7.2.0 on MacOS Mojave. When I keep an editor session open for a couple of hours, the kernel no longer works. Restarting and reconnecting don't resolve this. Only reopening the notebook helps (which is annoying). Previously, when working with earlier versions of Jupyter, IPython, and MacOS, I never had this issue.
I have tried reinstalling some of the components involved (notebook, jupyter, ipython) as suggested in #1892, but to no avail.
Here is some output on the console reporting an exception that might be helpful in tracking down the issue: