Restarting Rstudio server process to resolve hangs


Restarting rstudio to resolve hangs

Every so often Rstudio IDE environment can hang and become unresponsive. There multiple reasons for this to happen, from hanging jobs/sessions to rstudio trying to restore potentially problematic last used versions of projects. These document provides steps to return the workflow/Rstudio to working state.

Note 1: This doc is specific to Metworx Workflows 20.x and later.
Warning: These steps will kill running jobs and would require jobs to be resubmitted.

Additional Info

https://support.rstudio.com/hc/en-us/articles/218730228-Resetting-a-user-s-state-on-RStudio-Server Depending on what you want to achieve, you also may want to adjust your project/user settings https://support.rstudio.com/hc/en-us/articles/200549016-Customizing-RStudio

Solution

  1. From Metworx dashboard or workflow notification email, click on "Destkop" and login to your desktop environment for the workflow OpenDeskop
  2. In the opened deskop, open a terminal window(Konsole). OpenKonsole
  3. If running jobs are suspected to cause the issue, kill all running sessions. This will kill all running sessions/jobs. Stop the rstudio server process
killall -9  rsession 
sudo service rstudio-server stop 
  1. If Loading/user configuration is suspected to cause the issue, reset settings to default
 cd ~
 mv .rstudio/ .rstudio.old

DANGER ZONE: You also might want to consider removing additional configuration directories

Location When to remove
~/.config/rstudio/ When want to remove all user settings (Global Options) lost
~/.local/share/rstudio/ When want to reset open files and tabs
~/.rstudio/ Cleans out all active and suspended sessions

For example, to reset prior sessions info run these commands

mv ~/.config/rstudio ~/.config/rstudio.old 
mv ~/.local/share/rstudio/ ~/.local/share/rstudio.old 
  1. Restart Rstudio service

    sudo service rstudio-server start

In most cases, running these commands should resolve the issue(but will delete open and saved sessions! )

sudo service rstudio-server stop 
mv ~/.config/rstudio ~/.config/rstudio.old 
mv ~/.local/share/rstudio/ ~/.local/share/rstudio.old 
sudo service rstudio-server start
  1. Reload Rstudio browser window. You now should be able to open your prior project or create a new project.