Open toydarian opened 6 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.
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.