ConnectionMultiplexer.Connect takes too long if one of the nodes is down.
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.
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.
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.
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?