Enhancing multi/pipeline errors but defaults to redis-rb for parity - #299
Merged
Merged
Conversation
This was referenced Aug 27, 2026
Sasidharan3094
force-pushed
the
multi-pipeline-err-handling
branch
from
August 28, 2026 09:10
11429c7 to
9104287
Compare
jamesx-improving
approved these changes
Aug 28, 2026
jamesx-improving
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the multi/pipelined error-handling changes, the ExecAbortError split, and the incrbyfloat/geodist float-coercion fixes — the CommandError-embedding guards are consistent across both the batch and imperative-exec paths, and ExecAbortError < CommandError keeps all existing rescues working. LGTM.
Sasidharan3094
force-pushed
the
multi-pipeline-err-handling
branch
from
August 30, 2026 13:51
9104287 to
efa098c
Compare
Aryex
reviewed
Sep 1, 2026
Collaborator
Author
|
@Aryex I will address the review comments tomorrow |
Signed-off-by: Sasidharan Gopal <sasidharan.gopal94@gmail.com>
Signed-off-by: Sasidharan Gopal <sasidharan.gopal94@gmail.com>
Signed-off-by: Sasidharan Gopal <sasidharan.gopal94@gmail.com>
Sasidharan3094
force-pushed
the
multi-pipeline-err-handling
branch
from
September 3, 2026 06:59
a4b1fe7 to
b865142
Compare
Collaborator
Author
|
@Aryex I addressed the comments, can you review again |
Aryex
reviewed
Sep 8, 2026
Signed-off-by: Sasidharan Gopal <sasidharan.gopal94@gmail.com>
Collaborator
Author
|
@Aryex Fixed review comments. |
Aryex
approved these changes
Sep 9, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
pipelinedand the block form ofmultiraisedValkey::CommandErrorand discarded the entirereply array whenever a queued command failed at runtime (e.g.
INCRon a non-integer) - eventhough the server had already committed the other queued commands. This broke per-command
retry/idempotency logic, since callers had no way to see which commands succeeded.
This PR adds an opt-in
exception: falsemode to bothpipelinedandmultithat returns thereply array with a
Valkey::CommandErrorembedded at the failing command's slot instead ofraising, matching the server's "no rollback on a runtime error" semantics. The default
behavior of both methods is left as
exception: true(raise, array discarded) to stay in paritywith redis-rb 5.x, which was verified to behave identically to valkey-glide-ruby's pre-fix
default for both
pipelinedandmulti(redis-rb'smultihas no opt-out at all).Also fixes two related bugs found while investigating:
incrbyfloat/geodistreturned aStringinstead of aFloatwhen called insidemulti/exec's imperative (non-block) form, unlike a direct call.EXECreply could be silently coerced totrueby a boolean-typed command's reply reconversion (Utils::Boolify), hiding the error.Issue link
Closes #260
Features / Changes
pipelined's existingexception:kwarg is unchanged in shape;multi's block form gains amatching
exception:kwarg (defaulttrue) - a valkey-glide-ruby-specific extension, sinceredis-rb's
multihas no such option.exception: falseon either method returns the reply Array withValkey::CommandErrorembedded at the failing command's position; other commands' replies (and their
Futures) stayreachable.
Valkey::ExecAbortError < Valkey::CommandError, raised specifically for a genuinequeue-time abort (
RequestErrorType::EXECABORT) - so callers can distinguish "nothing ran, safeto retry" from a mid-EXEC runtime error, matching the Python/Node/Java/Go GLIDE clients.
multi'sexception:kwarg only affects the block form; passing it to the imperativemulti(no block) /#execpair now raisesArgumentErrorinstead of silently being ignored,since that path dispatches a single literal
EXECcommand with no equivalent raise/embedcontrol (redis-rb has no imperative
multi/execform at all to compare against - callingmultiwithout a block raisesLocalJumpErrorthere).incrbyfloat(string_commands.rb) andgeodist(geo_commands.rb) now applyUtils::Floatify, matching the existing convention used byhincrbyfloat/zincrby/zscore.reconvert_queued_replies(imperativeexec's reply reconversion) now skips re-coercing analready-embedded
CommandError, mirroring the existing guard insend_batch_commands.Testing
mainon a local standalone server(
127.0.0.1:6379): bothpipelinedandmultiraised and discarded the array, while afollow-up
GETconfirmed the successful command had committed server-side.redis-rb5.4.1 (same server, same scenario) to confirm this fix'sdefaults match redis-rb's own
pipelined/multidefaults exactly, withexception: falseasthe only divergence (an explicit, deliberate opt-in enhancement).
test/lint/string_commands.rb- default (exception: true) raises;exception: falsereturns the array with the error embedded.
test/lint/transaction_commands.rb- same coverage formulti's block form, plus floatcoercion parity between
multi/exec(block and imperative) and direct calls, plusmulti(exception: ...)without a block raisingArgumentError.test/unit/errors_test.rb(new) -ExecAbortErrorclass hierarchy.bundle exec rubocop lib test- clean.bundle exec rake test:unit- 123 tests, 0 failures.test/integration/standalone/commands_test.rbrun (multi/pipelined/geodist/incrbyfloatfilter) - 49 tests, 0 failures, 5 unrelated skips.
Checklist
Before submitting the PR make sure the following are checked:
bundle exec rubocop) and pass.