These are chat archives for ipython/ipython
We are implementing 'sparkmagic' kernel that requires session cleanup when it quits. We are using it with Jupyter. We ended up hacking Jupyter to send SIGTERM along with "shutdown_message" to the kernel. Our kernel will listen to SIGTERM and do proper cleanup.
At some point we need to add a feature to cancel existing statement, Kernel Nanny seems to support that