Skip to content

Simpervisor overrides the existing signal handlers #38

Open
@mahendrapaipuri

Description

@mahendrapaipuri

Proposed change

Simpervisor defines its own atexit implementation to register signal handlers. The issue is that sets its own signal handler for SIGINT and SIGTERM "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 by ServerApp. This can be easily verified by running a JupyterLab instance with jupyter-server-proxy installed. Start a simple web server from JupyterLab using jupyter-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 after ServerApp is killed.

Who would use this feature?

Anyone who is using simpervisor along with Jupyter ServerApp.

(Optional): Suggest a solution

Ensure that we register the existing signal handlers in _handlers list, if they exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions