jupyterq icon indicating copy to clipboard operation
jupyterq copied to clipboard

Jupyter server running after shutdown

Open Dianeod opened this issue 3 years ago • 0 comments

An issue has been raised where jupyterq_server.q is still running after the jupyter kernel has been properly shut down.

The following fixes were attempted:

  1. Adding a timer function to jupyterq_server.q to check if the handle to the kernel was closed and exit the process if so
.z.ts:{if[0~count .z.W;exit 0]};system"t 5000"; 

but the above did not work and the server was still present

  1. Adding code to jupyterq_kernel.q, to kill the the server once the kernel is closed
ch.sh.shutdown_request:{[z;s;mc]if[last allowstop;snd[z;s]kr[`shutdown_reply;mc]md[`restart]mc .`content`restart;system"kill ",string neg[srvh]".z.i";exit 0]}

The above addition worked, however hasn’t been fully tested to ensure that it doesn’t cause any side effects that may impact the average user so is not currently being added as a fix

Below is the versions within the environment

kdb 4.0
jupyterq 1.1.7
python 3.6
anaconda-client (1.6.9)
ipykernel (4.8.0)
ipython (6.2.1)
ipython-genutils (0.2.0)
jupyter-client (5.2.2)
jupyter-contrib-core (0.3.3)
jupyter-core (4.4.0)
notebook (5.4.0)
prompt-toolkit (1.0.15)
qtconsole (4.3.1)

Dianeod avatar Sep 04 '20 08:09 Dianeod