`BLMPOP` with COUNT 0 or numkeys 0 hangs

Open Beginner friendly
#3,750 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ggyuchive is already working on this.

Since Nov 3, 2026.

  • #3751 by @ggyuchive — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, redis
Domain
databases

Research direction

The BLMPOP argument handling lives in the command implementation under src/commands, where the COUNT and numkeys values are parsed and validated. Start by reproducing with the two commands from the issue against a local kvrocks build, then check that the parser rejects zero values before the blocking wait begins. Done means both commands return the expected ERR replies immediately, with a test added alongside the existing BLMPOP tests.

Written by the indexing model from the issue text.

Description

bug
Search before asking
  • I had searched in the issues and found no similar issues.
Version

Kvrocks unstable at commit 1933e9c7ef

Minimal reproduce step
RPUSH l a b
BLMPOP 0.02 1 l RIGHT COUNT 0
BLMPOP 0.02 0 LEFT COUNT 2
What did you expect to see?
> RPUSH l a b
(integer) 2
> BLMPOP 0.02 1 l RIGHT COUNT 0
(error) ERR count should be greater than 0
> BLMPOP 0.02 0 LEFT COUNT 2
(error) ERR numkeys should be greater than 0
What did you see instead?
> RPUSH l a b
(integer) 2
> BLMPOP 0.02 1 l RIGHT COUNT 0
(no reply)
> BLMPOP 0.02 0 LEFT COUNT 2
(no reply)
Anything Else?

No response

Are you willing to submit a PR?
  • I'm willing to submit a PR!
Dominant language
C++
Stars
4.5k
Forks
686
Avg merge
2d 19h
Merged PRs (30d)
37

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No 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.

More from apache/kvrocks

All issues in apache/kvrocks

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.