From 251f79736afd54bc7c9c1af332f048a5f685ff7d Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Mon, 18 Nov 2024 08:49:15 -0800 Subject: [PATCH] Avoid busy loop --- sequencer/src/context.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sequencer/src/context.rs b/sequencer/src/context.rs index 72de7d7db6..4842b14adf 100644 --- a/sequencer/src/context.rs +++ b/sequencer/src/context.rs @@ -584,6 +584,9 @@ async fn fetch_proposals( if let Err(err) = res { tracing::warn!("failed to fetch proposal: {err:#}"); + // Avoid busy loop when operations are failing. + sleep(Duration::from_secs(1)).await; + // If we fail fetching the proposal, don't let it clog up the fetching task. Just push // it back onto the queue and move onto the next proposal. sender.broadcast_direct((view, leaf)).await.ok();