GeezerVison is showing github.com — [Redis 8.12] Support set member expiration (SME) commands by atakavci · Pull Request #4828 · redis/jedis
Conversation
atakavci
commented
Nov 4, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adds the ten set member expiration commands introduced in Redis 8.12: SEXPIRE, SPEXPIRE, SEXPIREAT, SPEXPIREAT, STTL, SPTTL, SEXPIRETIME, SPEXPIRETIME, SPERSIST and SADDEX. Every command comes in a multi-member form and a single-member convenience form, on the String and binary APIs, in pipelines and transactions, and on the legacy Jedis client.
Key Decisions & Assumptions
- The API mirrors the existing hash field expiration methods: per-member replies come back as
List<Long>, and the *expire* commands take an optional ExpiryOption (NX/XX/GT/LT) overload instead of a dedicated params class.
- Single-member overloads (
sexpire(key, seconds, member), sttl(key, member), saddex(key, params, member), and so on) return a plain long instead of a one-element list. They send the same MEMBERS 1 <member> wire form and unwrap the reply with a new BuilderFactory.LONG_FROM_LIST builder, so callers with one member avoid the list boilerplate.
SADDEX gets a SAddExParams class that extends BaseSetExParams for ex/px/exAt/pxAt/keepTtl and adds mnx()/mxx(). Each group is a last-call-wins slot, and the command appends the MEMBERS <count> block itself.
- No client-side version check: on servers older than 8.12 the commands fail with the server's unknown-command error.
- New public API is annotated
@since 8.1.
Behavioral / Conceptual Changes
- Existing set methods are untouched, but their Javadoc now documents how Redis 8.12 propagates member expiration:
sunionstore keeps the farthest, sinterstore the nearest, sdiffstore the first set's, and smove moves the member with its expiration.
- Release notes for 8.1.0 gain a "Set member expiration commands" entry.
Testing
Unit tests cover argument encoding for every command, in both multi-member and single-member form, across CommandObjects, UnifiedJedis and PipeliningBase, plus SAddExParams ordering, equality and overriding behavior. Integration tests in the shared set test base, the Jedis set tests, and the pipeline tests exercise reply codes (-2/-1/0/1/2), per-member NX/XX/GT/LT semantics, past-time deletion, SADDEX conditions and the zero-modification reply, wrong-type errors, and the single-member variants returning the same codes as their list counterparts. They are gated with @EnabledOnCommand("SADDEX") so they skip on older servers.
Note Medium Risk
Broad new command surface and wire-format details tied to Redis 8.12 behavior; mistakes in argument ordering or reply parsing could confuse callers or break SME-heavy workloads, though the change is additive and guarded by integration tests.
Overview
Adds full client support for Redis 8.12 set member expiration: the sexpire / spexpire / sexpireAt / spexpireAt family (with optional ExpiryOption per member), sttl, spttl, sexpireTime, spexpireTime, spersist, and saddex backed by new SAddExParams (mnx / mxx plus ex / px / exAt / pxAt / keepTtl).
Multi-member calls return List<Long>; single-member overloads return a plain long, using new BuilderFactory.LONG_FROM_LIST to unwrap one-element array replies while still emitting MEMBERS 1 … on the wire. String and binary paths, UnifiedJedis, legacy Jedis, pipelines, and the various Set* command interfaces are all extended, and Protocol registers the new commands plus MEMBERS, MNX, and MXX keywords.
Docs and semantics: 8.1.0 release notes describe the commands; Javadoc on sdiffstore, sinterstore, sunionstore, and smove calls out how member expirations propagate in Redis 8.12. Tests add command-object, unified, pipeline, mocked, and integration coverage (including conditions, past-time deletes, saddex edge cases, wrong-type handling, and single-member variants), gated with @EnabledOnCommand("SADDEX") so they skip on servers without SME.
Reviewed by Cursor Bugbot for commit 01c6beb. Bugbot is set up for automated code reviews on this repo. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-06T10:06:00.077601Z |
01c6beb |
New commits |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afddc1ee6e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
private Keyword condition;
|
|
|
|
|
|
public static SAddExParams sAddExParams() {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @SInCE to the new parameter methods
The factory is new public API, as are mnx() and mxx(), but only the class-level Javadoc carries @since; generated method-level API documentation therefore cannot identify when these entry points were added. Add @since 8.1 to each of these three public methods.
AGENTS.md reference: AGENTS.md:L27-L31
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ggivo
changed the title
Support set member expiration(SME) commands (Redis 8.12)
[8.12] Support set member expiration(SME) commands (Redis 8.12)
Nov 5, 2026
This was referenced Nov 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba5471e6b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* The single integer of a one-element integer array reply, for the single-member variants of
|
|
|
* commands that reply with one integer per member (e.g. {@code SEXPIRE key 10 MEMBERS 1 m}).
|
|
|
*/
|
|
|
public static final Builder<Long> LONG_FROM_LIST = new Builder<Long>() {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @SInCE to the new response builder
When the 8.1 API documentation is generated, the newly exposed public LONG_FROM_LIST builder has no @since 8.1 tag, so consumers cannot determine when this API became available; add the tag to this declaration.
AGENTS.md reference: AGENTS.md:L27-L31
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ggivo
changed the title
[8.12] Support set member expiration(SME) commands (Redis 8.12)
[Redis 8.12] Support set member expiration (SME) commands
Nov 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 10, 2026
Reviewers
ggivo
ggivo approved these changes
a-TODO-rov
Awaiting requested review from a-TODO-rov
Uh oh!
There was an error while loading. Please reload this page.
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|