Open mahendrapaipuri opened 1 year ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Wieee what a great writeup!!! Thank you @mahendrapaipuri for writing this up so clearly!
Proposed change
Simpervisor defines its own atexit implementation to register signal handlers. The issue is that sets its own signal handler for
SIGINT
andSIGTERM
"potentially" overriding any existing handlers.An example use case when we use jupyter-server-proxy to start managed applications. It uses simpervisor behind the hood to supervise the proxy application. By the time simpervisor registers signal handlers, there are already existing handlers for sigint and sigterm by
ServerApp
. So, simpervisor overrides these handlers registered byServerApp
. This can be easily verified by running a JupyterLab instance withjupyter-server-proxy
installed. Start a simple web server from JupyterLab usingjupyter-server-proxy
and then doing a Ctrl+C on the terminal that is running JupyterLab will shutdown the Lab immediately without the usual prompt of shutdown confirmation.The signal handlers of the
ServerApp
cleans up the kernels and extensions before terminating itself. So, we lose this cleaning up tasks due to simpervisor overriding the handlers. We noticed on our JupyterHub deployment on our HPC platform that this can have a undesirable side effects of proxy processes lingering around even afterServerApp
is killed.Who would use this feature?
Anyone who is using
simpervisor
along with JupyterServerApp
.(Optional): Suggest a solution
Ensure that we register the existing signal handlers in _handlers list, if they exist.