-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
JupyterLab keeps polling the API even when it detects that the server stopped running #15211
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
This has been reported before, but the issue is closed: #11134 (thanks @krassowski ). Let's keep this issue open for pull requests. Thanks @lahwaacz for your contribution! |
@JasonWeill This is different from #11134 - false pop-ups are not the problem here, this issue is about JupyterLab polling even when the server is rightfully down. |
Yes, we noted this difference during the triage meeting, but wanted to link back to the previous one because it contains useful solutions for folks who may end up finding this issue due to false pop-ups. In either case, pull requests welcome! |
Another scenario to mention here... In systems where the user's authentication expires, JupyterLab keeps polling endpoints and silently fails with 403 messages. There are two issues with this:
We see this scenario often, since folks leave browser tabs open over a weekend, letting their cookie expire. When they return on Monday, they are confused why JupyterLab looks connected but they aren't able to do anything. While we have implemented a custom plugin to raise a modal when things look expired, we cannot easily stop all polling across the client. Plugins are usually the issue. Calling Would it make sense to provide a "PollingManager" mechanism where plugins can "register" any pollers they define and allow this manager to stop/start them when things like e.g. auth expiration happen? |
Description
When JupyterLab gets disconnected from the server and the server is stopped (e.g. by jupyterhub-idle-culler on JupyterHub due to inactivity), JupyterLab can detect this case and shows the following to the user:
However, JupyterLab keeps polling the server which results in many log messages on JupyterHub, such as:
and:
These are repeated every 30 seconds and everything is multiplied by the number of users that have an open JupyterLab session but stopped server.
Note that my JupyterHub runs on
sub.domain.tld/jupyter
so all endpoints in the logs are prefixed with/jupyter
.References: jupyterhub/the-littlest-jupyterhub#427, #3929
Reproduce
Expected behavior
When JupyterLab gets 424 status for these requests, it means that the hub is reachable (i.e. there is no general problem with network connection), but the user server was stopped. So JupyterLab should stop polling, because there is no point! Just let the user click the Restart button or add a Retry button if there is a possibility that the lost session/kernel may become alive again.
It also seems that JupyterLab polls an outdated endpoint
/user/<user>/api
, which causes many useless 302 redirects. If backward compatibility is needed, JupyterLab should remember the target of the 302 response and use it in all subsequent requests. Maybe JupyterHub should return 301 Moved Permanently instead of 302 Found.Context
All Jupyter packages (I run JupyterHub on Arch Linux so the package names and versions are most likely different from
pip
or other package managers):The text was updated successfully, but these errors were encountered: