redis/node-redis

Cluster connections fails after upgrade to 1.5.17 from 1.5.16

JimmyBjorklund opened this issue · 2 comments

Description

After upgrade to 1.5.17 from 1.5.16 the connect function never returns.

host: clustercfg.XXXXXXXmemorydb.eu-north-1.amazonaws.com
port is: 6379

    const options: RedisClusterOptions = {
      rootNodes: [{
        url:"rediss://" + this.config.redis.host + ":" + this.config.redis.port,
      }]
      ,defaults: {
        username: this.config.redis.username,
        password: this.config.redis.password,
        socket: {
          tls: false
        }
      }
    };
    this.redis = createCluster(options);
    console.log("Connecting to Redis Cluster: " + this.config.redis.host + ":" + this.config.redis.port);
    this.redis.on("error", (err) => Logger.error("Redis Cluster Error"));
    await this.redis
      .connect()
      .then(() => {
        console.log("Connected to Redis Cluster: " + this.config.redis.host + ":" + this.config.redis.port);
      })
      .catch((err) => {
        console.log("Error connecting to Redis Cluster: " + this.config.redis.host + ":" + this.config.redis.port);
        exit(1);
      });

Node.js Version

v20.15.0

Redis Server Version

Engine version 7.1

Node Redis Version

No response

Platform

AWS

Logs

No response

I just tried connecting to a cluster locally and it seems like it works.. I'm not sure what the bug is, and without being able to reproduce it we won't be able to fix it..
If you want we can debug this together, ping me on the redis discord (my handle is @leibale) :)

Created a sample repo that show the issue.

https://github.com/JimmyBjorklund/redis-test

Hanging version prints ( running version 1.6.0 )

> redis-test@0.0.11 pstart
> node ./app/app.js

Connecting to Redis Cluster: clustercfg.connect-memdb.xxxxx.memorydb.eu-north-1.amazonaws.com:6379
Let's kick it!

Working (running version 1.5.16):

redis-test@0.0.11 pstart
node ./app/app.js

Connecting to Redis Cluster: clustercfg.connect-memdb.xxxxx.memorydb.eu-north-1.amazonaws.com:6379
Let's kick it!
Connected to Redis Cluster: clustercfg.connect-memdb.xxxxx.memorydb.eu-north-1.amazonaws.com:6379
Connected to Redis Cluster: clustercfg.connect-memdb.xxxxx.memorydb.eu-north-1.amazonaws.com:6379

Prebuilt images (working is working and latest is broken):
docker pull ghcr.io/jimmybjorklund/redis-test:working
docker pull ghcr.io/jimmybjorklund/redis-test:latest