Ron Rejwan - 175 - Feb 22, 2015

We use the Redis client ver. 4.0.33 and we have issues in the pub/sub when our clients need to reconnect. 

For example, when our service provider, RedisLabs, had made some changes in the nodes, but kept the same endpoint, some of our machines were unable to reconnect. 

Another example, after changing nodes to different AZ in AWS, our machines were unable to connect to the new nodes.

This was only resolved by restarting the app server.

Is this a known issue that is resolved in later client versions?
Thanks

Ron Rejwan:

Thanks we’ll try it out :slight_smile:

The Redis Client Managers will only connect to redis server ip’s it’s been configured with, i.e. it wont reconnect to new IP’s it doesn’t know about.

The new RedisSentinel class that’s available (but unannounced yet as it’s still being tested) will reconnect to master IP’s it doesn’t know about, but this requires having a Redis Sentinel instance (which is what monitors what active redis server instances are) it connects to. Otherwise you can manually failover to new redis server IP’s with the IRedisFailover.FailoverTo() API’s. 

Heartbeats support was added to RedisPubSubServer in v4.0.34 which helps detects dropped connections if you’re using RedisPubSubServer (or anything that uses it): 
https://github.com/ServiceStack/ServiceStack/blob/master/docs/2014/release-notes.md#heartbeats-enabled-on-redispubsubserver