Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry once to many on MOVED error at cluster #882

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/redis/cluster.rb
Expand Up @@ -216,7 +216,10 @@ def try_send(node, method_name, *args, retry_count: 3, &block)
node.public_send(method_name, *args, &block)
rescue CommandError => err
if err.message.start_with?('MOVED')
assign_redirection_node(err.message).public_send(method_name, *args, &block)
raise if retry_count <= 0
node = assign_redirection_node(err.message)
retry_count -= 1
retry
elsif err.message.start_with?('ASK')
raise if retry_count <= 0
node = assign_asking_node(err.message)
Expand Down