Skip to content

Commit

Permalink
Merge pull request #33 from nihohit/fanout
Browse files Browse the repository at this point in the history
Clarify that top fanout operations don't retry.
  • Loading branch information
nihohit authored Sep 2, 2023
2 parents dcbbc21 + 931d23a commit 424c387
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ enum Next<I, C> {
},
Reconnect {
request: PendingRequest<I, C>,
target: OperationTarget,
target: String,
},
RefreshSlots {
request: PendingRequest<I, C>,
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -428,7 +428,7 @@ where
}
ErrorKind::IoError => Next::Reconnect {
request: this.request.take().unwrap(),
target: OperationTarget::Node { address },
target: address,
}
.into(),
_ => {
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 424c387

Please sign in to comment.