-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Requests to /hub/user/<username>/api/* does not trigger spawn when server is down #2293
Comments
With some more investigation, almost all the 404s are for API requests. All 404s: 3176 This seems high. In another high activity hub I run, there are 4 404s - to sessions and terminals API calls. |
This is the result of #2001 because the implicit spawns were causing a problem ( a culled server with a left-open browser tab would respawn indefinitely, effectively making it impossible to cull idle servers). Note that any non-api request (e.g. opening a notebook, tree view, terminal, etc.) will trigger the spawn. It is only api requests that are not allowed to trigger respawn. So it seems like we have two concrete cases where the automatic respawn on API requests is both a problem if it happens and a problem if it doesn't. I'm not a fan of a config option for everything, but maybe there isn't another solution to two mutually exclusive use cases. Another option could be to allow POST/PUT/DELETE requests to trigger a respawn, that way a tab left-open that keeps refreshing the API wouldn't do anything, but any request to take a clear action (e.g. save the notebook or restart the kernel) would trigger a respawn (I think the initial request would still fail). That might be a bit too much, though. |
@minrk another option is to add code to the jupyterhub-singleuser related code that does some JS that tells the user their server is dead and they should refresh. That seems much more explicit and smoother than autospawn from API requests. |
Yup! In that case, it's probably mostly a jupyterlab;jupyter/notebook javascript PR to be made? |
@minrk yeah, I think so. We don't do any JS in jupyter notebook right now, I think. How do you think we should detect liveness? Add an API endpoint that returns true if it's running with no side effects? Maybe such an endpoint already exists. |
There's an /api/status endpoint. That's usually what I recommend for checking if a server is running. |
Can this be closed? |
Yes, I think this should have been closed by #2435 - implicit spawning has proved to be something we shouldn't be doing. |
Me and @ryanlovett are investigating reports of launch errors from our hub users.
My understanding is that if a user's server is down, and they hit /hub/user//*, it should trigger respawn. This lets users close their laptops for the day, come back the next day, and sortof have their servers automagically start back up.
It's possible that my understanding is now out of date. But I see several places in logs where the following sequence happens:
The second line makes me think the user is authenticated (since the log contains the username as additional info at the end), but respawn is not triggered. This leads to users seeing errors when they'd normally just see a respawn.
The text was updated successfully, but these errors were encountered: