GET does not check its arity and with no arguments returns the key from the previous command
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Find the GET command handler and its existing argument-count checks; the issue does not name a file or test. Compare its validation with STRLEN, then run the relevant GET command tests. Done means GET with zero or multiple arguments returns the stated wrong-number-of-arguments error and does not read a key.
Written by the indexing model from the issue text.
Description
Describe the bug
GET accepts any number of arguments. Extra arguments are ignored. With no arguments, GET does not fail: it returns the value of the key named by the previous command on the same connection, so it seems to read stale parse state. Other commands check arity, for example STRLEN k extra returns ERR wrong number of arguments for 'STRLEN' command.
Steps to reproduce the bug
On one connection:
SET k value-k => +OK
GET => $7 value-k (value of the key from the previous command)
SET other value-other => +OK
GET other x => $11 value-other (extra argument ignored)
GET => $11 value-other
On a fresh connection, GET with no arguments returns a null reply.
Expected behavior
GET takes exactly one key. GET with no arguments and GET key extra both return ERR wrong number of arguments for 'get' command, and nothing is read.
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. The no-argument case is the more serious part: a malformed command reads data chosen by an earlier command instead of failing.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/garnet
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
GEOADD updating a member's position keeps the member's old TTL, so the new position is silently deletedMay be free again @Saad-elnagar claimed this 9 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/garnet#2265 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 2 days
-
Blocking pops with a short timeout can time out and reply nil although a key has elementsPossibly taken @badrishc claimed this 7 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 2 days
All issues in microsoft/garnet
Similar issues
-
bug effort:S P3
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nightscout/nocturne#3093 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100