StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

ConnectionMultiplexer.Connect takes too long if one of the nodes is down.

Open gautamdhameja opened this issue 11 years ago • 3 comments

When one of the Redis nodes, given in the config string/options, is down then the connection multiplexer takes more than 2 minutes to connect. It connects successfully to the nodes that are running but takes too long. However, when all nodes are running then the connect operation is completed very fast. Also checked the connect method logs by passing the string writer but these logs also do not show the reason for the connect delay. The logs clearly show that the down node did not respond. But the wait on the down node is not justified.

gautamdhameja avatar Dec 22 '14 11:12 gautamdhameja

I have verified, below change will solve your issue https://github.com/StackExchange/StackExchange.Redis/pull/129.

Without above fix. when one of the node is down it takes around 10 seconds to connect. When both are up it connects instantly in line 20 Milliseconds.

With above fix. when one of the node is down it takes around 1 seconds to connect. When both are up it connects instantly in line 20 Milliseconds.

SiddharthChatrolaMs avatar Dec 29 '14 23:12 SiddharthChatrolaMs

I am experience the same issue even for just a one node configuration so I am looking forward for this fix. Right now I have to implement my own timeout around the Connect call as a workaround.

jbengtssondn avatar Jan 06 '15 21:01 jbengtssondn

This seems to be fixed on NuGet pkg 1.0.394. I've updated my pkg version and can't reproduce it anymore. Does anybody else confirm?

mfelicio avatar Jan 27 '15 17:01 mfelicio