Sitelet https://github.com/StackExchange/StackExchange.Redis/pull/3192
Skip to content

Return 0 from SortedSetRemove(Async) for an empty member array - #3192

Merged
mgravell merged 1 commit into
StackExchange:mainfrom
AbhinavMir:sortedsetremove-empty-array
Aug 25, 2026
Merged

mgravell merged 1 commit into
StackExchange:mainfrom
AbhinavMir:sortedsetremove-empty-array

Conversation

@AbhinavMir

Copy link
Copy Markdown
Contributor

ZREM needs one member or more. An empty array built a one-argument ZREM.
The server refused it with "wrong number of arguments". In a transaction
this became EXECABORT.

An empty array now returns 0 and does not go to the server. A null array
still throws an ArgumentNullException. The exception now names the
"members" parameter. Before, it named the "values" parameter of the
Message.Create overload. This matches SetRemove(Async).

@mgravell mgravell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we do this short-circuit in some other places, so this is not unreasonable; LGTM

@mgravell
mgravell merged commit 8b31020 into StackExchange:main Aug 25, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants