Closed jacoblovatt1987 closed 5 years ago
It is by design that Rserve keeps sessions open - in interactive settings it is not unusual to keep a session open for days. However, Rserve relies on the underlying TCP/IP stack to inform it if the connection was severed or not.
Rserve does provide several options to detect broken connections. First, you can set the keep.alive
option to yes
in order to enable keep-alive feature of the OS socket stack. Unfortunately the details are OS-specific and Rserve doesn't have much control about how frequently that is done.
Second, you can use oob.idle.interval
which specifies how often you want Rserve to generate an OOB idle
message. If that message fails it will cause the connection to close. However, this only works if you have OOB enabled, since that's the only mode in which the client is expecting any packages from the server - without OOB the client is the only source of packets so the server cannot send such idle probes.
On my Rserve instance I have (using the source directive) loaded a simple model and make predictions against that model using RSClient library in R.
If I simulate a network interruption between the client and server, Rserve doesn't seem to do any cleanup of idle forks. Is this by design, and what options are sensible to clean up idle sessions (to reclaim memory etc.)?