Skip to content

Commit a06216f

Browse files
committed
Handle lag gracefully (sender outpaces receiver).
1 parent 8c61a64 commit a06216f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/src/tests/timeboost/timeboost_handover.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use timeboost::sequencer::{Output, SequencerConfig};
1515
use timeboost::types::{Block, BlockInfo, BundleVariant, DecryptionKeyCell, KeyStore};
1616
use timeboost_utils::types::logging::init_logging;
1717
use tokio::select;
18+
use tokio::sync::broadcast::error::RecvError;
1819
use tokio::sync::{broadcast, mpsc};
1920
use tokio_util::sync::CancellationToken;
2021
use tokio_util::task::TaskTracker;
@@ -85,6 +86,9 @@ async fn run_handover(
8586
Ok(Cmd::Bundle(bundle)) => {
8687
s.add_bundles(once(bundle));
8788
}
89+
Err(RecvError::Lagged(e)) => {
90+
warn!("lagging behind: {e}");
91+
}
8892
Err(err) => panic!("command channel error: {err}")
8993
},
9094
out = s.next() => match out {

0 commit comments

Comments
 (0)