File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
crates/apollo_consensus_orchestrator/src Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -269,11 +269,16 @@ async fn get_proposal_content(
269269 // If the blob writing operation to Aerospike doesn't return a success status, we
270270 // can't finish the proposal. Must wait for it at least until batcher_timeout is
271271 // reached.
272- let remaining = ( args. batcher_deadline - args. deps . clock . now ( ) )
272+ let remaining_duration = ( args. batcher_deadline - args. deps . clock . now ( ) )
273273 . to_std ( )
274274 . unwrap_or_default ( )
275- . max ( MIN_WAIT_DURATION ) ; // Ensure we wait at least 1 ms to avoid immediate timeout.
276- match tokio:: time:: timeout ( remaining, args. cende_write_success . borrow_mut ( ) ) . await {
275+ . max ( MIN_WAIT_DURATION ) ; // Ensure we wait at least 1 ms to avoid immediate timeout.
276+ match tokio:: time:: timeout (
277+ remaining_duration,
278+ args. cende_write_success . borrow_mut ( ) ,
279+ )
280+ . await
281+ {
277282 Err ( _) => {
278283 return Err ( BuildProposalError :: CendeWriteError (
279284 "Writing blob to Aerospike didn't return in time." . to_string ( ) ,
Original file line number Diff line number Diff line change @@ -447,14 +447,14 @@ pub(crate) fn truncate_to_executed_txs(
447447 // Truncate `content` to keep only the first `final_n_executed_txs`, preserving batch
448448 // structure.
449449 let mut executed_content: Vec < Vec < InternalConsensusTransaction > > = Vec :: new ( ) ;
450- let mut remaining = final_n_executed_txs;
450+ let mut remaining_tx_count = final_n_executed_txs;
451451
452452 for batch in content {
453- if remaining < batch. len ( ) {
454- executed_content. push ( batch. into_iter ( ) . take ( remaining ) . collect ( ) ) ;
453+ if remaining_tx_count < batch. len ( ) {
454+ executed_content. push ( batch. into_iter ( ) . take ( remaining_tx_count ) . collect ( ) ) ;
455455 break ;
456456 } else {
457- remaining -= batch. len ( ) ;
457+ remaining_tx_count -= batch. len ( ) ;
458458 executed_content. push ( batch) ;
459459 }
460460 }
You can’t perform that action at this time.
0 commit comments