Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise errors from #pipelined instead of returning them
It seems redis-cluster-client intentionally decides to return errors from #pipelined, rather than raising them. I note that in #37 it was written: >> In Grab’s Redis Cluster library, the function >> Pipeline(PipelineReadOnly) returns a response with an error for >> individual reply. >> Instead of returning nil or an error message when err != nil, we could >> check for errors for each result so successful queries are not affected. >> This might have minimised the outage’s business impact. > > I prefer the above behavior. It's certainly true that returning the individual results from pipelined gives strictly more information than raising an exception. UNFORTUNATELY, redis-client chooses the _opposite_ option; if any query caused an error, after processing the entire pipeline it raises rather than returns; see: https://github.com/redis-rb/redis-client/blob/932c5e8909ede7575d56a117773be39f40e2da88/lib/redis_client/connection_mixin.rb#L60 I think consistency with redis-client is very valuable to have for redis-cluster-client, so I would suggest that changing the behaviour here (perhaps with a major version bump?) might be a good idea? Alternatively, althought I think this would be even _more_ confusing IMO, we could keep the error handling as-is here but patch it in redis-rb to raise instead of return.
- Loading branch information