Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Sep 26, 2024
1 parent 4a26cdf commit 864eefa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/redis_client/cluster/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def send_transaction(client, redirect:)
end
end

def send_pipeline(client, redirect:)
def send_pipeline(client, redirect:) # rubocop:disable Metrics/AbcSize
replies = client.ensure_connected_cluster_scoped(retryable: @retryable) do |connection|
commands = @pipeline._commands
client.middlewares.call_pipelined(commands, client.config) do
Expand All @@ -138,6 +138,9 @@ def send_pipeline(client, redirect:)
return if replies.last.nil?

coerce_results!(replies.last)
rescue ::RedisClient::ConnectionError
@router.renew_cluster_state if @watching_slot.nil?
raise
end

def coerce_results!(results, offset: 1)
Expand Down Expand Up @@ -167,6 +170,9 @@ def handle_command_error!(err, redirect:) # rubocop:disable Metrics/AbcSize
elsif err.message.start_with?('ASK')
node = @router.assign_asking_node(err.message)
try_asking(node) ? send_transaction(node, redirect: redirect - 1) : err
elsif err.message.start_with?('CLUSTERDOWN Hash slot not served')
@router.renew_cluster_state if @watching_slot.nil?
raise err
else
raise err
end
Expand Down

0 comments on commit 864eefa

Please sign in to comment.