-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
The jupyter process is staying up and not exiting even though it has "shut down" from shutdown_no_activity_timeout and is no longer listening on the configured port.
When configuring our Jupyter notebook (also run via Docker) we pass the following arguments:
jupyter notebook \
--ip 0.0.0.0 \
--allow-root \
--no-browser \
--log-level=DEBUG \
--NotebookApp.allow_password_change=False \
--NotebookApp.quit_button=False \
--NotebookApp.shutdown_no_activity_timeout=60 \
--MappingKernelManager.cull_idle_timeout=60 \
--MappingKernelManager.cull_interval=10 \
--MappingKernelManager.cull_connected=True \
--MappingKernelManager.cull_busy=False
And the behavior we are seeing is that:
- It is correctly culling idle kernels after 60s
- It is (usually) correctly shutting down the server after there are no kernels and the no activity timeout has exceeded
- When the server is shutdown, the PROCESS DOES NOT EXIT so the docker container just hangs waiting for the process to exit
- Looking at netstat shows that our configured port
8888was beingLISTENEDto before shutdown and is no longer being listened to post shutdown, but the container remains up (and therefore the process has not yet exited). - When shutting down the server manually (not by the
NotebookApp.shutdown_no_activity_timeoutbut by sending it a termination signal) it exits correctly.
One lead we have is that Websocket closed appears in the logs when shutting down the notebook manually, but does not appear when shut down due to shutdown_no_activity_timeout so our hypothesis is that there is a bug in the shutdown_no_activity_timeout code which is not correctly or fully shutting down the jupyter process.
This might be the same or similar issue as #5328 but unclear if that one is shutdown_no_activity_timeout related or if they are different. I didn't fully follow #4868 but it could also be related?