Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

RPOP/LPOP with a count return a bulk string instead of an array when one element is left

Open Beginner friendly
#2,323 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start at Garnet’s RPOP and LPOP command handling and the tests for list pop commands; the issue does not name specific files. Reproduce the one-element case with a count and compare its RESP reply with the two-element case. Done means count-form replies are arrays, including a one-element result, and a missing key returns null.

Written by the indexing model from the issue text.

Description

Describe the bug

RPOP key count and LPOP key count must always reply with an array when count is given. Garnet returns a bare bulk string when the list holds one element, so the reply type depends on the list length. Clients that parse the count form as an array fail on that reply.

Steps to reproduce the bug
RPUSH one x       => :1
RPOP one 2        => $1 x          (bulk string)

RPUSH two x y     => :2
RPOP two 5        => *2 y x        (array, as expected)

RPUSH one x       => :1
LPOP one 2        => $1 x          (bulk string)
Expected behavior

As in Redis 6.2+ (RPOP): with count, the reply is an array, so RPOP one 2 on a one-element list returns *1\r\n$1\r\nx\r\n. A missing key returns a null reply.

Release version

v2.2.5 (ghcr.io/microsoft/garnet:2.2.5, default options). Also seen on v2.1.8.

IDE

Not applicable. Commands sent over a raw TCP connection.

OS version

Docker on Windows 11 (Linux container).

Additional context

Found while running the integration suite of Respire, a .NET Redis client, against Garnet. I could not find an existing issue or pull request for this.

Dominant language
C#
Stars
12.1k
Forks
716
Avg merge
2d 2h
Merged PRs (30d)
65

Getting set up

  • 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 microsoft/garnet

All issues in microsoft/garnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.