Skip to content
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 fails on Windows #96

Closed
gaborcsardi opened this issue Jan 23, 2018 · 3 comments
Closed

Timeout fails on Windows #96

gaborcsardi opened this issue Jan 23, 2018 · 3 comments

Comments

@gaborcsardi
Copy link
Member

From #58:

callr::r(function() {
  message("hi")
  Sys.sleep(3)
  message("hi2")
  Sys.sleep(3)
  message("hi3")
}, timeout = 1)
@gaborcsardi
Copy link
Member Author

gaborcsardi commented Jan 23, 2018

Reproduce without callr:

system.time(processx::run(file.path(R.home("bin"), "R"), c("-q", "-e", "Sys.sleep(10)"), timeout = 1))

@gaborcsardi
Copy link
Member Author

So, the problem is that callr starts R.exe on Windows, and this starts another R process, RTerm.exe I think.

processx/callr kills the R.exe process, but not the other RTerm.exe process, and probably because we are reading output from the Rterm.exe process (the file objects are passed to it), processx::run (and thus callr::r) keeps running.

The solution would be to start Rterm.exe directly, instead or R.exe, I think. That seems to work just fine, and needs to be fixed in callr.

@gaborcsardi
Copy link
Member Author

This was callr specific, see r-lib/callr#34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant