From 931d23acaf76994393f2b41a7626cebf6c7cfaea Mon Sep 17 00:00:00 2001 From: Shachar Langbeheim Date: Fri, 1 Sep 2023 08:10:12 +0000 Subject: [PATCH] Clarify that top fanout operations don't retry. --- redis/src/cluster_async/mod.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/redis/src/cluster_async/mod.rs b/redis/src/cluster_async/mod.rs index 4907c8d59..fe893d8b3 100644 --- a/redis/src/cluster_async/mod.rs +++ b/redis/src/cluster_async/mod.rs @@ -343,7 +343,7 @@ enum Next { }, Reconnect { request: PendingRequest, - target: OperationTarget, + target: String, }, RefreshSlots { request: PendingRequest, @@ -385,7 +385,7 @@ where let address = match target { OperationTarget::Node { address } => address, OperationTarget::FanOut => { - // TODO - implement retries on fan-out operations + // Fanout operation are retried per internal request, and don't need additional retries. self.respond(Err(err)); return Next::Done.into(); } @@ -428,7 +428,7 @@ where } ErrorKind::IoError => Next::Reconnect { request: this.request.take().unwrap(), - target: OperationTarget::Node { address }, + target: address, } .into(), _ => { @@ -1073,13 +1073,8 @@ where Next::Reconnect { request, target, .. } => { - poll_flush_action = match target { - OperationTarget::Node { address } => poll_flush_action - .change_state(PollFlushAction::Reconnect(vec![address])), - OperationTarget::FanOut => { - poll_flush_action.change_state(PollFlushAction::RebuildSlots) - } - }; + poll_flush_action = + poll_flush_action.change_state(PollFlushAction::Reconnect(vec![target])); self.inner.pending_requests.lock().unwrap().push(request); } }