jupyterlab-hub icon indicating copy to clipboard operation
jupyterlab-hub copied to clipboard

Check for running server and prompt to restart

Open minrk opened this issue 6 years ago • 3 comments
trafficstars

polls /api/status, showing dialog on failure

  • adds restart-server action
  • restart-server action opens new tab pointed to /hub/spawn to trigger the new spawn

Improvements that could be made:

  1. restart with API request instead of new tab (not reliable because API token may not still be valid with the Hub after stop)
  2. use /hub/spawn/:user/:server spawn urls, which are new in Hub 1.0. This PR won't properly restart named servers. This also requires jupyterlab to make the username and server name available to PageConfig (or we can parse the url).
  3. hook into lab's existing Connection Lost event

Fixes #83

Screenshots

Screen Shot 2019-03-25 at 15 36 05

minrk avatar Mar 25 '19 14:03 minrk

Wow @minrk this is an excellent idea I think!

I wonder what happens if this competes with other errors that tend to show when you loose connectivity to the server, will you get two dialog boxes, one after the other, will you only get one?

If this works properly, this would be a big UX win!! :tada:

I cannot do much insightful review of the technical changes though, but I picked up some insights while reading them. I'm excited about this PR! :D

consideRatio avatar Mar 25 '19 19:03 consideRatio

That's what I was referring to with the hook into lab's existing Connection Lost event. That event will can still occur, so there can be a bit of a fight for which dialog the user is shown. Ideally, we would override the connection lost dialog with this as well.

minrk avatar Mar 26 '19 15:03 minrk

Hey all, jupyterlab/jupyterlab#6399 provides a new IConnectionLost token, which can be overridden by extensions, to handle a lost server connection. This should get around the dialog race. It won't be usable until a release, but should allow this PR to move forwards.

ian-r-rose avatar May 24 '19 14:05 ian-r-rose