jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.62k stars 4.88k forks source link

[ZMQbg/1] can't be killed!!! #4828

Open wildkid1024 opened 5 years ago

wildkid1024 commented 5 years ago

My notebook is running in the backgroud and I use command & to do that. But when I close a kernel and kill the backgroud process and I use the command kill -9. Then I find some process named [ZMQbg/1] which is runing, it can't be killed by any command, and its ppid become init(1). so what should I do to kill it without reboot?

kevin-bates commented 5 years ago

You should always use kill <pid> or kill -15 <pid> (SIGTERM) when terminating the notebook server, otherwise its signal handler to cleanup (including an attempt to stop any running kernels) will not be invoked.

It's not clear to me under what conditions ZMQbg processes come into play, but getting inherited by init would be consistent with not getting cleaned up on termination.

when I close a kernel

Are you specifically shutting the kernel down or just closing the notebook tab? Just asking since the latter would leave the kernel running along with any supporting processes.

At any rate, try not using -9 (SIGKILL) and see if you still see the zombie ZMQbg processes.

(You'll probably need to reboot to clear up the current zombies since they're owned by init. Please try the kill -15 experiment first so you'd only need to reboot once should it prove unhelpful.)

ghost commented 4 years ago

I came here because of similar problems. I just had to use sudo then it worked. (I'm using CoreOS)

wildkid1024 commented 4 years ago

I came here because of similar problems. I just had to use sudo then it worked. (I'm using CoreOS)

To prevent the same thing,I think that you must close the browser tab(local or remote) before you use command 'kill -9' !