Skip to content

executeIsolated causes uncaughtException when client connection resets #2044

@tugtugtug

Description

@tugtugtug

The pooled clients are not handling any of the errors emitted by the socket via

this.#onSocketError(new SocketClosedUnexpectedlyError());

and is causing node to report these as uncaughtException and abort the process.

So, as soon as executeIsolated gets called, which starts a pooled client, and if the connected server goes away, the client will die with an uncaughtException due to the exception thrown by the socket above.

2022-03-16T20:39:58.139Z error: uncaughtException: Socket closed unexpectedly
Error: Socket closed unexpectedly
    at Socket.<anonymous> (/test/node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)
    at Object.onceWrapper (events.js:520:26)
    at Socket.emit (events.js:400:28)
    at TCP.<anonymous> (net.js:686:12)

Environment:

  • Node.js Version: v14.19.0
  • Redis Server Version: 6.0.5
  • Node Redis Version: [email protected]
  • Platform: debian bullseye

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