Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpervisor overrides the existing signal handlers #38

Open
mahendrapaipuri opened this issue Jun 27, 2023 · 2 comments · May be fixed by #39
Open

Simpervisor overrides the existing signal handlers #38

mahendrapaipuri opened this issue Jun 27, 2023 · 2 comments · May be fixed by #39
Labels
bug Something isn't working

Comments

@mahendrapaipuri
Copy link

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.

@mahendrapaipuri mahendrapaipuri added the enhancement New feature or request label Jun 27, 2023
@welcome
Copy link

welcome bot commented Jun 27, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

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.
welcome
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! 👋

Welcome to the Jupyter community! 🎉

@consideRatio
Copy link
Member

Wieee what a great writeup!!! Thank you @mahendrapaipuri for writing this up so clearly!

@consideRatio consideRatio added bug Something isn't working and removed enhancement New feature or request labels Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants