DEV Community

nik
nik

Posted on

node js client hangs on connection to redis cluster when master changes

Hi All! I have a Redis Cluster with three master shards. Each Master Shard node has one replica. The client on node.js connects to the cluster and sends requests at 500 requests per second.
When one Master fails and the Master on the replica changes, i.e. the structure of the classer changes, the node.js client stops and hangs endlessly without any error messages.
If I stop the node.js client and start it again, it reads the changed cluster structure and works fine.
My question is what needs to be added to the node.js client code (timeout or something else) so that when the cluster structure changes, node.js client itself reconnects to the cluster without restarting. Thanks in advance.

Top comments (0)