1

I've recently run into an issue when using Rstudio-Server that multiple sessions are spawned instead of a single session. In my case (see below) five sessions are created instead of one. This happens even after trying the normal solutions: deleting ~/.rstudio, clearing .GlobalEnv, and restarting R. Note, there is no spawning issue when using the R command prompt.

processes

My belief about the source of this problem is that it is due to a prematurely terminated mclapply. Here are the relevant docs from the parallel package. (discovered after the fact)

It is strongly discouraged to use these functions in GUI or embedded environments, because it leads to several processes sharing the same GUI which will likely cause chaos (and possibly crashes). Child processes should never use on-screen graphics devices.

At least one other person has had the same error as me but there is no documented solution that I can find. As the warning has already been ignored, I would appreciate any pointers that can help me get untangled.

Edit: I am still encountering the error but was able to catch the ephemeral script sourcing issue that I believe is causing this problem. Unfortunately, I don't know what other files are being sourced and therefore what settings need to be changed. Grrrrr..... enter image description here

zach
  • 29,475
  • 16
  • 67
  • 88
  • `pkill -9 rsession`? – nrussell Feb 25 '16 at 01:59
  • the processes will die but when the session is restarted all of the sessions are invoked. It seems there may be some environment script invoked by Rstudio when initiating the session. Unfortunately its hard to reproduce as I think there is some minimum time between sessions for things to run. I'm poking around here for inspiration: https://github.com/rstudio/rstudio/blob/master/src/cpp/r/session/RSession.cpp – zach Feb 25 '16 at 03:47
  • Hm that's interesting. I'll look into this more when I'm able to. – nrussell Feb 25 '16 at 11:12
  • @nrussell any chance you been able to look at this? I am still plagued.... – zach Apr 02 '16 at 21:58

0 Answers0