Fix raising command error for first command in pipeline #788
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.
Problem
When the first command in a redis pipeline has invalid arguments, then the Redis::CommandError object is passed to the transform block which can cause the exception to be transformed and ignored. For example,
This problem was mentioned before for zrange in #733 but the fix was specific to the FloatifyPairs transform block so didn't also fix the problem for the
set
command that usesBoolifySet
for the transform block when using thenx: true
option.Solution
Remove the special case in Redis::Client#call_pipelined to
read
the first command reply which was there only to set@reconnect = false
, since it is fine to call that in the loop after each call toread
.I've removed the workaround that #733 added for this problem which isn't needed now that the exception gets raised before the transform block gets called. That way we can also rely on the test in that PR to make sure this works for any transform block.