You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signal handlers registered on the proxied app are not passed from jupyter to the proxied app when the jupyter process is interrupted [Ctrl + C]
Expected behaviour
When the jupyter process is interrupted using Ctrl + C, this signal ie. SIGINT, should be passed on to the child processes of jupyter such as the proxied apps created by the jupyter server proxy.
Actual behaviour
When jupyter process is interrupted using Ctrl +C, SIGINT is only passed to the root jupyter process, which kills all the proxied apps created by jupyter server proxy.
The signal handlers registered in the proxied apps are not able to 'catch' the signal because the root jupyter process consumes the interrupt without passing it to the proxied apps created by jupyter server proxy.
How to reproduce
Create a python package which runs a simple aiohttp server.
Register signal handlers to trap termination signals. This is to perform some shutdown-background-tasks and then close.
In setup.py of the python package add the entrypoint jupyter_serverproxy_servers and point it to the function which starts the server.
Start jupyter notebook and launch the aiohttp server within the jupyter notebook.
Send interrupt signal to the shell by pressing Ctrl + C.
After performing step 5 above, you can see that the interrupt signal was not passed to the proxied app (here its aiohttp server) and thereby leading to runtime errors in the shell:
File"/usr/lib/python3.7/asyncio/base_events.py", line582, inrun_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: EventloopstoppedbeforeFuturecompleted.
This error shows up because, after catching the interrupt signal, I perform some cleanup work and then shutdown the server. That cleanup work is asynchronously finished using the function loop.run_until_complete() provided by asycio package
Your personal set up
Running from a local virtual env which was created using the below command:
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.
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! 👋
Bug description
Signal handlers registered on the proxied app are not passed from jupyter to the proxied app when the jupyter process is interrupted [Ctrl + C]
Expected behaviour
When the jupyter process is interrupted using Ctrl + C, this signal ie. SIGINT, should be passed on to the child processes of jupyter such as the proxied apps created by the jupyter server proxy.
Actual behaviour
When jupyter process is interrupted using Ctrl +C, SIGINT is only passed to the root jupyter process, which kills all the proxied apps created by jupyter server proxy.
The signal handlers registered in the proxied apps are not able to 'catch' the signal because the root jupyter process consumes the interrupt without passing it to the proxied apps created by jupyter server proxy.
How to reproduce
jupyter_serverproxy_servers
and point it to the function which starts the server.After performing step 5 above, you can see that the interrupt signal was not passed to the proxied app (here its aiohttp server) and thereby leading to runtime errors in the shell:
This error shows up because, after catching the interrupt signal, I perform some cleanup work and then shutdown the server. That cleanup work is asynchronously finished using the function
loop.run_until_complete()
provided byasycio
packageYour personal set up
Running from a local virtual env which was created using the below command:
OS:
Debian GNU/Linux 10 (buster) x86_64
Version(s):
python: 3.7
Jupyter versions:
jupyter core : 4.7.1
jupyter-notebook : 6.4.0
qtconsole : 5.1.1
ipython : 7.25.0
ipykernel : 6.0.1
jupyter client : 6.1.12
jupyter lab : not installed
nbconvert : 6.1.0
ipywidgets : 7.6.3
nbformat : 5.1.3
traitlets : 5.0.5
Full environment
The text was updated successfully, but these errors were encountered: