redis / redis/node-redis

uncaught exception when command is aborted

Open
#2,165 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

When a command is aborted with a signal its removed from the waitingToBeSent queue:

https://github.com/redis/node-redis/blob/0752f143a6dbc83df0a5db987907e8794aabe9db/packages/client/lib/client/commands-queue.ts#L153-L156

But then when a reply comes in, there's no handlers on the queue anymore so an error gets thrown.

https://github.com/redis/node-redis/blob/0752f143a6dbc83df0a5db987907e8794aabe9db/packages/client/lib/client/commands-queue.ts#L117-L119

Is there anything that can be done here to prevent this as there's no way to catch this error?

Environment:

  • Node.js Version: 16
  • Redis Server Version: 6.2
  • Node Redis Version: @redis/client @ 1.1.0
  • Platform: macOS / Google Cloud Run

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/client/lib/client/commands-queue.ts, especially the waitingToBeSent removal around lines 153-156 and reply handling around lines 117-119. Trace the aborted-command and subsequent-reply flow, then verify that an aborted command's late reply no longer causes an uncaught error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, redis, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.