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

Expired keys still affect type checks, SETNX and DEL

Open
#2,244 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@TedHartMS is already working on this.

Since Oct 15, 2026.

Assessment

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

Research direction

Start by running the redis-cli script from the report against a local Garnet instance on port 6379 to confirm LLEN returns WRONGTYPE, DEL returns 1 and SETNX returns 0 on expired keys. The payload does not name source files, so locate the expiration check the key lookup uses and see why these three commands skip it. Done means LLEN returns 0, DEL returns 0 and SETNX returns 1 for the expired keys, matching Redis.

Written by the indexing model from the issue text.

Description

Describe the bug

Expired keys are still treated as present by LLEN, DEL and SETNX after their TTL has elapsed.

Steps to reproduce the bug

On a local test instance at port 6379, with redis-cli:

k="upstream-repro-$(date +%s)-$$"
r() { redis-cli -p 6379 "$@"; }
r SET "$k:s" v PX 10
sleep 0.1
r LLEN "$k:s"                # actual: WRONGTYPE
r SET "$k:d" v PX 10
sleep 0.1
r DEL "$k:d"                 # actual: 1
r RPUSH "$k:l" a
r PEXPIRE "$k:l" 10
sleep 0.1
r SETNX "$k:l" v             # actual: 0
Expected behavior

Expected LLEN 0, DEL 0 and SETNX 1, as in Redis.

Screenshots

No response

Release version

Garnet main at 44cf0bdb7d36 (reports 2.2.1).

IDE

No response

OS version

Linux arm64

Additional context

No response

Dominant language
C#
Stars
12k
Forks
711
Avg merge
2d 7h
Merged PRs (30d)
56

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.