-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timeout for remoter::batch #56
Comments
Interesting. I'm able to kill it with ctrl-c in a terminal:
What OS and R interface are you using? |
I can also kill it this way, but I would like to be able to detect if it takes too long. For example, this also blocks, even though I have specified a timeout of 2 seconds: |
To be more specific, I can kill it if I run it in a cygwin terminal in windows with Rscript: |
I have investigated a little more and it is not trivial to implement something with a timeout and non-blocking requests. This is due to the ZeroMQ settings used. In fact, with remoter if you make a batch request to a server that is not yet up and start the remoter server later, then the server replies! In practice, I check if port 55555 is open at the server (with a utility like nc) and hope that an actual remoter server is running at this port. We could close the issue if you want. |
I add all socket options to pbdZMQ. The |
Is there a way to specify a timeout for a remoter::batch request, e.g., in case the remote server is non-existent or is not running a remoter server? For example, the following code blocks forever:
remoter::batch(addr = 'non_existent_host', script = 'ls()')
I tried with
R.utils::withTimeout
, but is does not work, because I guess that the block happens in C code where user interrupts are not allowed.The text was updated successfully, but these errors were encountered: