s-u / Rserve

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

[Feature request] request timeout #106

Open toydarian opened 6 years ago

toydarian commented 6 years ago

Would it be possible to add a (configurable) timeout for child processes and kill processes if they run longer than the configured timeout?

E.g. I open a sessions and the code contains an infinite loop. I want the "broken" process to be terminated after x seconds and some kind of exception sent to the client.

Background: I have an application that allows users to send R code to RServe. Some of the users cause processes to hang, run for a very long time or even indefinitely. Till now I kill all R processes from time to time and restart RServe. A timeout would be perfect to clean up "broken" jobs automatically.

s-u commented 5 years ago

This is not entirely straight-forward, because R doesn't always allow interrupt, so we can only address cases where the code causing the infinite loop is interruptible. In all other cases you can only kill the process and close the connection.