My provisioner works on Jupyter Lab but not on Voila.
I then discovered that the cleanup method, which by the documentation should be called only as part of the shutdown kernel sequence is actually called on kernel start.
I added in my provisioner a log entry for each function. This is the log of Jupyter Lab
[I 2023-02-21 14:57:52.826 ServerApp] init
[I 2023-02-21 14:57:52.826 ServerApp] pre_launch
[I 2023-02-21 14:57:53.347 ServerApp] launch_kernel
[W 2023-02-21 14:57:53.381 ServerApp] Message signing is disabled. This is insecure and not recommended!
[I 2023-02-21 14:57:53.381 ServerApp] Kernel started: 5239215c-9ad8-4a14-b2f5-78d95a8073e7
[I 2023-02-21 14:57:56.372 ServerApp] poll
[I 2023-02-21 14:57:59.372 ServerApp] poll
This is the log of Voila:
[Voila] init
[Voila] pre_launch
[Voila] launch_kernel
[Voila] WARNING | Message signing is disabled. This is insecure and not recommended!
[Voila] Kernel started: f71f8edd-2e1e-4f32-bcf1-b9e51733304f
[Voila] poll
[Voila] ERROR | cleanup False <<< As you see cleanup is called right after launch_kernel
[Voila] poll
[Voila] poll
I also tried this with the default local_provisioner by adding a log line in the cleanup function (sorry for the ugly debug method :) and I could see it was called as well, so this tends to exclude that my custom provisioner is the cause.
Description
I discovered this while developing a custom jupyter kernel provisioner.
My provisioner works on Jupyter Lab but not on Voila.
I then discovered that the
cleanup
method, which by the documentation should be called onlyas part of the shutdown kernel sequence
is actually called on kernel start.I added in my provisioner a log entry for each function. This is the log of Jupyter Lab
This is the log of Voila:
I also tried this with the default
local_provisioner
by adding a log line in the cleanup function (sorry for the ugly debug method :) and I could see it was called as well, so this tends to exclude that my custom provisioner is the cause.Reproduce
self.log.error("CLEANUP!!!!!!!")
inside functioncleanup
oflocal_provisioner.py
: https://github.com/jupyter/jupyter_client/blob/adff6b1d4389c885ee7ff4764fc5ffad6fcbe53f/jupyter_client/provisioning/local_provisioner.py#L140-L153[Voila] ERROR | CLEANUP!!!!!!!
right on kernel startExpected behavior
Not this to happen :)
Context
Troubleshoot Output
If using JupyterLab
Installed Labextensions