Skip to content

CPU pegged while using createCluster() against AWS ElastiCache Valkey cluster #3075

Description

@madhusudancs

Description

It seems to me like there is a bug in this code snippet:
https://github.com/redis/node-redis/blob/master/packages/client/lib/cluster/cluster-slots.ts#L481-L489

We use AWS Elasticache Valkey and recently migrated one of our ReplicationGroups to Cluster-compatible mode to distribute the load.

From time to time, we see our clients entering the aforementioned loop with both master.length = 0 and replicas.length = 0 and endlessly spinning completely pegging the CPU.

We have tried using Elasticache's primary endpoint, configuration endpoint and node endpoints to no luck. We are not sure why AWS returns 0 masters/replicas but regardless, code shouldn't even enter this loop when both replicas and masters are empty.

Because when the clients enter this state, it is irrecoverable.

Node.js Version

22.17.x

Redis Server Version

7.x

Node Redis Version

4.x+

Platform

Linux

Logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions