Skip to content

Commit 7640700

Browse files
committed
Do not retry blocking_call on ReadTimeout
That's how `redis-client` behaves.
1 parent 17669fb commit 7640700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/redis_client/cluster/router.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def send_command(method, command, *args, &block) # rubocop:disable Metrics/AbcSi
6464

6565
# @see https://redis.io/topics/cluster-spec#redirection-and-resharding
6666
# Redirection and resharding
67-
def try_send(node, method, command, args, retry_count: 3, &block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
67+
def try_send(node, method, command, args, retry_count: 3, &block) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
6868
node.send(method, *args, command, &block)
6969
rescue ::RedisClient::CommandError => e
7070
raise if retry_count <= 0
@@ -85,7 +85,8 @@ def try_send(node, method, command, args, retry_count: 3, &block) # rubocop:disa
8585
else
8686
raise
8787
end
88-
rescue ::RedisClient::ConnectionError
88+
rescue ::RedisClient::ConnectionError => e
89+
raise if method == :blocking_call_v || (method == :blocking_call && e.is_a?(RedisClient::ReadTimeoutError))
8990
raise if retry_count <= 0
9091

9192
update_cluster_info!

0 commit comments

Comments
 (0)