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*1000 is harmful! #7

Closed
Demetrio92 opened this issue Feb 20, 2018 · 2 comments
Closed

timeout*1000 is harmful! #7

Demetrio92 opened this issue Feb 20, 2018 · 2 comments

Comments

@Demetrio92
Copy link

I don't know whether this also affects windows users, but the sys call to ping on linux is executed with timeout * 1000 passed to -W argument. My man ping (ubuntu 16.04) says:

       -W timeout
              Time to wait for a response, in **seconds**. The option affects only timeout in 
              absence of  any responses, otherwise ping waits for two RTTs.

Therefore calling ping('lalala.com') dead-locks the R session (ok, actually, only affects Rstudio, and not the terminal, but nonetheless).
The documentation does not say anything about the measurement units, and the default for timeout argument is set to 1,

IMO, two things should be changed:

  1. Documentation should be clear about the units
  2. The default should be max 10 seconds
@gaborcsardi
Copy link
Member

The dead lock will be solved by #8. Sadly, it seems that different ping programs take different units, so I would need to rewrite the ICMP ping in C: #11.

Btw. there is a new is_up() function, and I guess people would need that more often than ping().

@gaborcsardi
Copy link
Member

Nevertheless if looks like Linux has the timeout in seconds, so I can do that change already now.

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

2 participants