-
Notifications
You must be signed in to change notification settings - Fork 39
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
RStudio should be shut down on container exit #2878
Comments
There has been some discussion previously about having rstudio shutdown more gracefully. This is probably something the datahub service team should discuss and add to the feature enhancement roadmap. |
@cboettig Thanks for making the enhancement request! To understand the severity of the student impact and scope this request accordingly in our backlog, Can you answer the below questions,
@ryanlovett Is this a request that could be scoped this month (from a feasibility standpoint) |
Sure!
|
RStudio daemonizes itself when it starts, so it isn't being passed the SIGTERM when the user pod stops. So it exits uncleanly, causing corruption and other state issues. tini should properly reap the rstudio processes during exit. Ref berkeley-dsep-infra#2878 Ref berkeley-dsep-infra#2891
We get it from apt, so it should be somewhere else in $PATH Ref berkeley-dsep-infra#2878 Ref berkeley-dsep-infra#2891
We inherit from the geospatial rocker images, which ship with the s6 process manager. However, JupyterHub doesn't launch them using that. We consistently use tini across all our images instead. Ref berkeley-dsep-infra#2878 Ref berkeley-dsep-infra#2891
@cboettig ok, can you re-open this if you encounter that error again? |
@yuvipanda launched a session at r.datahub.berkeley.edu this morning, switched into an active project, and then just closed the tab. Returning to it this afternoon, the session restarts and again displays the "The previous R session was abnormally terminated ...." message. Doesn't look like I have permissions to reopen the issue though. |
Apparently the warning is enabled when the "abend" session setting is set in ~/.rstudio/sessions/active/*/session-persistent-state, https://community.rstudio.com/t/restarting-rstudio-server-in-docker-avoid-error-message/10349/2. The warning can reportedly be squelched by changing the session setting, though I agree it'd be best to close RStudio properly. See |
@ryanlovett thanks! Note that the other side-effect of closing RStudio improperly which is more of a nuisance than the warning itself is the fact that RStudio exits the currently active project (if any), though it keeps open the active file. This means the user often does not immediately realize they are no longer working inside the correct project (i.e. git repo) until later. (RStudio presumably exits the active project in case it was responsible for the crash; thereby allowing the user to get back into RStudio without getting into an endless crash loop; so that much makes sense. I do think RStudio's crash message would be better if it mentioned this behavior though, or at least also closed the active documents). |
RStudio daemonizes itself when it starts, so it isn't being passed the SIGTERM when the user pod stops. So it exits uncleanly, causing corruption and other state issues. tini should properly reap the rstudio processes during exit. Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
We get it from apt, so it should be somewhere else in $PATH Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
We inherit from the geospatial rocker images, which ship with the s6 process manager. However, JupyterHub doesn't launch them using that. We consistently use tini across all our images instead. Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
RStudio daemonizes itself when it starts, so it isn't being passed the SIGTERM when the user pod stops. So it exits uncleanly, causing corruption and other state issues. tini should properly reap the rstudio processes during exit. Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
We get it from apt, so it should be somewhere else in $PATH Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
We inherit from the geospatial rocker images, which ship with the s6 process manager. However, JupyterHub doesn't launch them using that. We consistently use tini across all our images instead. Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
RStudio daemonizes itself when it starts, so it isn't being passed the SIGTERM when the user pod stops. So it exits uncleanly, causing corruption and other state issues. tini should properly reap the rstudio processes during exit. Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
We get it from apt, so it should be somewhere else in $PATH Ref berkeley-dsep-infra/datahub#2878 Ref berkeley-dsep-infra/datahub#2891
Bug description
When a student leaves a session idle (e.g. at the end of a class lab session etc), datahub shuts down the instance (naturally). However, it seems that it does not first shutdown the running RStudio session. When the student logs back in, RStudio reports that:
This warning would be scary but mostly harmless. However, if the student is using an active "Project" in RStudio, RStudio also closes the current open project (presumably as precaution, since restoring the previous state in the event of a real crash could create a vicious cycle). Students may not notice their most recent project is no longer active, until they look for a git menu or such.
For comparison, in the rocker project, the RStudio instance is run by an init service (s6), which handles a shutdown of the service on container exit: https://github.com/rocker-org/rocker-versioned2/blob/master/scripts/install_rstudio.sh#L108-L110
Thanks
Environment & setup
RStudio on r.datahub.berkeley.edu
How to reproduce
The text was updated successfully, but these errors were encountered: