s-u / Rserve

Fast, flexible and powerful server providing access to R from many languages and systems
http://RForge.net/Rserve
Other
282 stars 65 forks source link

If any process calls `R_CleanTempDir` it is removed for all sessions #194

Open s-u opened 1 year ago

s-u commented 1 year ago

If R_CleanTempDir() is called in any of the worker processes, it will remove R's temporary directory for all sessions using the same temporary directory. By default, all R sessions will share the same temporary directory which can cause removal of tempdir() for existing sessions.

One way to force independent temporary directories is to remove tempdir() before forking and call tempdir(TRUE) after forking which creates a new temporary directory.

Note that R_CleanTempDir is called as part fo the cleanup of any R process, so this can happen in any cases where R initiates a shutdown including SIGPIPE handler or explicit user exit.