Skip to content

Make connections timeout if ConnectTimeout is set. #37

Merged
merged 1 commit into from Apr 19, 2012

2 participants

@jschlicht

The current Redis Client implementation hangs for up to 15 seconds if
asked to connect to a Redis server that is currently offline. This code
allows developers to override this behavior by explicitly setting a
connection timeout.

If ConnectTimeout is set to zero milliseconds (the default setting), RedisClient will still hang for up to 15 seconds if the server is unavailable.

If ConnectTimeout is set and the server cannot be contacted, an "Unable to
Connect" RedisException is raised.

This patch builds on a change I made to the ServiceStack/Redis.Interfaces project. I added the ConnectTimeout property in that project. That change must be
pulled first so that this code can compile.

I did not replace lib/ServiceStack.Interfaces.dll, as my build environment
is likely different than that of the project maintainers.

@jschlicht jschlicht Make connections timeout if ConnectTimeout is set.
The current Redis Client implementation hangs for up to 15 seconds if
asked to connect to a Redis server that is currently offline. This code
allows developers to override this behavior by explicitly setting a
connection timeout.

If ConnectTimeout is set to zero milliseconds (the default setting), RedisClient will still hang for up to 15 seconds if the server is unavailable.

If ConnectTimeout is set and the server cannot be contacted, an "Unable to
Connect" RedisException is raised.

This patch builds on a change I made to the ServiceStack/Redis.Interfaces project. I added the ConnectTimeout property in that project. That change must be
pulled first so that this code can compile.

I did not replace lib/ServiceStack.Interfaces.dll, as my build environment
is likely different than that of the project maintainers.
ddeb0ce
@mythz mythz merged commit 6d9c9d8 into ServiceStack:master Apr 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.