Skip to content

Commit

Permalink
payload_manager bugfix: reset responders in fut
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Jan 11, 2025
1 parent c98242a commit 421d5ce
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions consensus/src/payload_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ async fn process_optqs_payload<T: TDataInfo>(
let data_fut = data_fut_guard.as_mut().expect("must be initialized");
// Protection against race, check the iteration number before rescheduling.
if data_fut.iteration == iteration {
let batches_and_responders = data_ptr
let (batches_and_responders, responders) = data_ptr
.batch_summary
.iter()
.map(|summary| {
Expand All @@ -641,18 +641,22 @@ async fn process_optqs_payload<T: TDataInfo>(
if let Some(author) = block.author() {
signers.push(author);
}
let responders = Arc::new(Mutex::new(signers));

(summary.info().clone(), Arc::new(Mutex::new(signers)))
((summary.info().clone(), responders.clone()), responders)
})
.collect();
data_fut.fut = request_txns_from_quorum_store(
batches_and_responders,
block.timestamp_usecs(),
batch_reader,
)
.boxed()
.shared();
data_fut.iteration = iteration + 1;
.unzip();
*data_fut = DataFetchFut {
fut: request_txns_from_quorum_store(
batches_and_responders,
block.timestamp_usecs(),
batch_reader,
)
.boxed()
.shared(),
iteration: iteration + 1,
responders,
};
}
}
result
Expand Down

0 comments on commit 421d5ce

Please sign in to comment.