bwlewis / rredis

R client for Redis
http://illposed.net/
93 stars 25 forks source link

timeout in redisConnect() #7

Closed sherbert closed 11 years ago

sherbert commented 12 years ago

1.6.7 introduces a timeout parameter for redisConnect() that is giving me trouble with R 2.15.1 under OS X 10.8 (Mountain Lion). The issue appears to be that timeouts that large just don't work on Mountain Lion, as the call consistently fails with timeout > 100,000,000, while my colleague's 10.7 machine and our Ubuntu 10.04 servers are fine. I can clearly just set the timeout in the call, but it seems like setting the default to 100,000,000 (~3 years) might be nice. I'm not sure if socketConnection might also allow 0 to mean "no timeout".

[R.app GUI 1.52 (6188) x86_64-apple-darwin9.8.0]

> library(rredis)

> redisConnect("redis-equinix")
Error in socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) : 
  cannot open the connection
In addition: Warning message:
In socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
  redis-equinix:6379 cannot be opened

> redisConnect("redis-equinix", timeout=100000000L)

> redisConnect("redis-equinix", timeout=100000001L)
Error in socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) : 
  cannot open the connection
In addition: Warning message:
In socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
  redis-equinix:6379 cannot be opened
>
bwlewis commented 12 years ago

I'm not sure what led to the large timeout value there instead of just using 0 (probably an issue on Windows, but I'll investigate that); but it is over-large anyway. I'll scale it back for now instead of setting to zero, but test with zero. The R documentation says that the POSIX max timeout value should be less than 31 days, so I'll set it there for now.

I'll leave this open until I decide why not just use zero.

bwlewis commented 11 years ago

Leaving the new timeout value at 31 days.