Problem Overview

Many compute-intensive bioinformatics workflows, such as single-cell analyses at scale, often involve long-running scripts. Users frequently need to run the run long-running tasks and expect to be able to come back to an active session to check in on the task. Currently reloading or closing the browser UI means that it's impossible to see the task progress or even interrupt it using RStudio.

Steps to reproduce the problem

  1. Run RStudio server, open the browser UI
  2. In the R Console REPL, run system("sleep 100")
  3. Reload the browser tab
  4. The UI will not load (will show the gray screen with the spinner) for 100 seconds (until the system command finishes)

What Latch’s RStudio Patch Fixes

To solve the above problem, the Latch engineering team shipped a patch to the RStudio source code, as outlined in the pull request below:

https://github.com/rstudio/rstudio/issues/15053

With the new RStudio patch, the UI should load and display the same state as before the tab was reloaded.

Demo of RStudio Before and After

Below, we demonstrated the experience of using the old versus new version of RStudio for analyzing 1M+ cells using Seurat and BPCells.

Case 1: Run a line of code in R Console. Close tab while other process running

Old Rstudio

We closed the RStudio tab while other processes are running → Relaunched RStudio → The job got killed. User had to re-run the script, resulting in wasted compute.

old_r_not_work.mov

New RStudio

We closed RStudio tab while other processes are running → Relaunched Rstudio → The browser opened, and the code continued to run seamlessly.