Skip to content

Uncaught Exception: TypeError: Cannot destructure property 'resolve' of '__classPrivateFieldGet(...).shift(...)' as it is undefined #2626

Closed as not planned
@Alastair-Spencer

Description

@Alastair-Spencer

Description

Hello 👋🏻

Starting to add some resillency to our codebase and I was testing what would happen when the max clients have been reached.

I have ran config set maxclients 1 in my Redis server and started the project to see how this would be handled.

This fails with the following:

  • ConnectionTimeoutError
  • TypeError
  • SocketClosedUnexpectedlyError

Replication code

      client = createClient({
        url: 'redis://localhost:6379',
        socket: {
          connectTimeout: 1000,
        },
        pingInterval: 4 * 60 * 1000,
      });

      client.on('error', (err) => {
        console.log('Redis Error', err);
      });
      client.on('connect', () => console.log('Redis client is connecting'));
      client.on('reconnecting', () => console.log('Redis is reconnecting'));
      client.on('ready', () => console.log('Redis client is ready'));

Node.js Version

18.17.1

Redis Server Version

7.2.1

Node Redis Version

4.6.10

Platform

MacOS (Docker redis-stack)

Logs

ConnectionTimeoutError: Connection timeout
    at Socket.<anonymous> (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/socket.js:177:124)
    at Object.onceWrapper (node:events:628:28)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:489:12)
    at Socket._onTimeout (node:net:571:8)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)

log: Redis is reconnecting
log: Redis client is connecting
log: Redis client is ready

Uncaught Exception: TypeError: Cannot destructure property 'resolve' of '__classPrivateFieldGet(...).shift(...)' as it is undefined.
    at Object.onReply (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/commands-queue.js:62:25)
    at RESP2Decoder.write (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/RESP2/decoder.js:119:26)
    at RedisCommandsQueue.onReplyChunk (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/commands-queue.js:154:72)
    at RedisSocket.<anonymous> (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/index.js:394:84)
    at RedisSocket.emit (node:events:514:28)
    at RedisSocket.emit (node:domain:489:12)
    at Socket.<anonymous> (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/socket.js:201:42)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Socket.Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

SocketClosedUnexpectedlyError: Socket closed unexpectedly
    at Socket.<anonymous> (/Users/alastair/projects/repo/node_modules/@redis/client/dist/lib/client/socket.js:194:118)
    at Object.onceWrapper (node:events:629:26)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:489:12)
    at TCP.<anonymous> (node:net:323:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions