Skip to content

Unhandled promise rejection triggered in DoublyLinkedList after executeTask() #3062

@udnes99

Description

@udnes99

Description

We just detected an unhandled promise rejection that was triggered while issuing a command or a .execute() using a pool instance. Due to limited stack trace, I am not sure if it was a dedicated client obtained by .execute() or just a client retrieved for the execution of a single command. I am not that familiar with the internals of the Redis SDK, but I am guessing some kind of race condition within the library related to the acquisition and release of client instances for tasks, or some bug in the linked list.

Node.js Version

22.18.0

Redis Server Version

7.4.0

Node Redis Version

5.8.0

Platform

Linux

Logs

TypeError: Cannot set properties of undefined (setting 'next')
  File "/app/node_modules/.pnpm/@redis+client@5.8.0/node_modules/@redis/client/dist/lib/client/linked-list.js", line 76, col 32, in DoublyLinkedList.remove
    node.previous.next = node.next;
  File "/app/node_modules/.pnpm/@redis+client@5.8.0/node_modules/@redis/client/dist/lib/client/pool.js", line 262, col 28, in #returnClient
    this.#clientsInUse.remove(node);
  File "/app/node_modules/.pnpm/@redis+client@5.8.0/node_modules/@redis/client/dist/lib/client/pool.js", line 248, col 50
    .finally(() => this.#returnClient(node));
  File "<anonymous>"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions