scicloj / clojisr

Clojure speaks statistics - a bridge between Clojure to R
https://scicloj.github.io/clojisr/
Eclipse Public License 2.0
150 stars 10 forks source link

Abandoned R processes #45

Closed genmeblog closed 4 years ago

genmeblog commented 4 years ago

When Java is killed or stopped without closing session, R process is still running which can cause strange error for another sessions (see: https://clojurians.zulipchat.com/#narrow/stream/151924-data-science/topic/r-interop)

We should check the R processes and safely run fresh on not used port informing use that R processes exist. Or force somehow to shutdown R when there is no connection.

genmeblog commented 4 years ago

Just to leave for future use.

https://stackoverflow.com/questions/27066588/rserve-server-how-to-terminate-a-blocking-instance-eval-taking-forever

Sys.getpid() returns RConnection process.

genmeblog commented 4 years ago

It's fixed. Port assignment is done safely now. Also JVM tries to close all the open sessions and kill R processes.