Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ impl ConsensusContext for SequencerConsensusContext {

let transaction_converter = self.deps.transaction_converter.clone();
let mut stream_sender = self.start_stream(HeightAndRound(height.0, init.round)).await;
tokio::spawn(
let handle = tokio::spawn(
async move {
let res =
send_reproposal(id, block_info, txs, &mut stream_sender, transaction_converter)
Expand All @@ -644,6 +644,13 @@ impl ConsensusContext for SequencerConsensusContext {
}
.instrument(error_span!("consensus_repropose", round = init.round)),
);
// Spawn a follow-up task to detect panics. Without this, if the reproposal
// task panics, the JoinError is silently swallowed when the handle is dropped.
tokio::spawn(async move {
if let Err(e) = handle.await {
error!("Reproposal task panicked: {e:?}");
}
});
}

async fn validators(&self, _height: BlockNumber) -> Result<Vec<ValidatorId>, ConsensusError> {
Expand Down
Loading