Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zwang28 committed Feb 18, 2024
1 parent 3b3287d commit 82106ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/meta/src/barrier/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ impl StreamRpcManager {
f(client, input).await.map_err(|e| (node.id, e))
});

// similar to join_all, but return early if a timeout occurs since the first error.
let stream = FuturesUnordered::from_iter(iters);
pin_mut!(stream);
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel();
Expand All @@ -296,12 +297,12 @@ impl StreamRpcManager {
Either::Right((Some(Err(err)), _)) => {
results_err.push(err);
if is_err_timeout {
continue;
continue;
}
is_err_timeout = true;
let tx = tx.clone();
tokio::spawn(async move {
tokio::time::sleep(Duration::from_secs(5)).await;
tokio::time::sleep(Duration::from_secs(3)).await;
let _ = tx.send(());
});
}
Expand Down

0 comments on commit 82106ca

Please sign in to comment.