Skip to content

executeIsolated causes uncaughtException when client connection resets #2044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tugtugtug opened this issue Mar 16, 2022 · 1 comment
Closed
Labels

Comments

@tugtugtug
Copy link

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
@kpturner
Copy link

kpturner commented Jun 8, 2022

I am using version 4.0.6 and I still get this problem

SocketClosedUnexpectedlyError: Socket closed unexpectedly
    at Socket.<anonymous> (.../node_modules/@node-redis/client/dist/lib/client/socket.js:182:118)
    at Object.onceWrapper (node:events:510:26)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at TCP.<anonymous> (node:net:687:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

The error handler on the client does not fire.

EDIT - Ahh - I am using duplicate to create subscriptions and if I add a listener there it fires on both the parent and the duplicate. But if I do not add a listener on the duplicate nothing fires at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants