-
Notifications
You must be signed in to change notification settings - Fork 309
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
Slower atexit methods do not run to completion #1422
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
This comment was marked as off-topic.
This comment was marked as off-topic.
1 similar comment
This comment was marked as off-topic.
This comment was marked as off-topic.
I think I am seeing this issue as well. I have written a library that generates large amounts of binary data which is written to disk into temporary files and then memory mapped. In order to guarantee that these files are properly removed at shutdown, I have registered Occasionally, some files are not removed on shutdown, and they persist on disk. I have observed this behaviour only when using jupyterlab, never when using just the Python interpreter to run my code/scripts. The fact that some files are deleted and some are not strongly suggests to me that the cleanup functions are being interrupted by a signal while they are running. |
This is likely KernelManager.shutdown_wait_time, which defaults to 5 seconds (which is probably too short for a default). You can set in # give kernels 30 seconds to shutdown cleanly before we terminate them
c.KernelManager.shutdown_wait_time = 30 |
Hi @minrk and thanks for the reply! This will probably fix the issue, but I was wondering - wouldn't it be better (if possible) to ask the user whether or not to forcibly stop the kernel rather than just silently killing it? I am thinking something like the UI in Window Managers when an application is failing to immediately close after pressing the |
Description
Cleanup methods that are slower do not run to completion when restarting kernel.
Reproduce
Expected behavior
The "hello.txt" should have been created.
Context
Additional info
Jupyter lab shows a TimeoutError on console.
This error is gone when using a larger kernel_info_timeout.
However, the atexit method still does not run to completion.
The above code works as expected if run from IPython (inside shell).
I have been trying to find the spot in Jupyter Lab, Jupyter Server and Ipython that is responsible for killing the kernel. But I since I am not familiar enough, I haven't figured it out.
I had posted this issue on JupyterLab jupyterlab/jupyterlab#16276 (comment)
and was told this might be a better place to report the issue.
The text was updated successfully, but these errors were encountered: