@@ -536,34 +536,34 @@ async fn try_send_to_orderpool<V, T, S>(
536536}
537537
538538/// Gracefully shuts down the builder, waiting for tasks to complete with timeouts.
539- ///
540- /// First waits for all tasks (inner jobs + critical tasks) with a graceful timeout.
539+ /// First waits for all tasks (non-critical and critical tasks) with a graceful timeout.
541540/// If the timeout is reached, signals the abort token and waits only for critical tasks
542541/// with a second timeout.
543542async fn shutdown_builder (
544543 global_cancellation : CancellationToken ,
545544 global_abort : CancellationToken ,
546- inner_jobs_handles : Vec < JoinHandle < ( ) > > ,
545+ non_critical_tasks_join_handles : Vec < JoinHandle < ( ) > > ,
547546 critical_tasks_join_handles : Vec < JoinHandle < ( ) > > ,
548547) {
549548 info ! ( "Builder shutting down" ) ;
550549 global_cancellation. cancel ( ) ;
551550
552551 // Collect handles into FuturesUnordered for concurrent waiting
553- let mut inner_jobs: FuturesUnordered < _ > = inner_jobs_handles. into_iter ( ) . collect ( ) ;
552+ let mut non_critical_tasks: FuturesUnordered < _ > =
553+ non_critical_tasks_join_handles. into_iter ( ) . collect ( ) ;
554554 let mut critical_tasks: FuturesUnordered < _ > = critical_tasks_join_handles. into_iter ( ) . collect ( ) ;
555555
556556 // First phase: wait for all handles with graceful timeout
557557 let graceful_deadline = tokio:: time:: Instant :: now ( ) + GRACEFUL_SHUTDOWN_TIMEOUT ;
558558
559559 loop {
560- if inner_jobs . is_empty ( ) && critical_tasks. is_empty ( ) {
560+ if non_critical_tasks . is_empty ( ) && critical_tasks. is_empty ( ) {
561561 break ;
562562 }
563563
564564 tokio:: select! {
565565 biased;
566- Some ( result) = inner_jobs . next( ) , if !inner_jobs . is_empty( ) => {
566+ Some ( result) = non_critical_tasks . next( ) , if !non_critical_tasks . is_empty( ) => {
567567 if let Err ( err) = result {
568568 warn!( ?err, "Job handle await error" ) ;
569569 }
@@ -575,7 +575,7 @@ async fn shutdown_builder(
575575 }
576576 _ = tokio:: time:: sleep_until( graceful_deadline) => {
577577 warn!(
578- remaining_inner_jobs = inner_jobs . len( ) ,
578+ remaining_inner_jobs = non_critical_tasks . len( ) ,
579579 remaining_critical_tasks = critical_tasks. len( ) ,
580580 "Graceful shutdown timeout reached, signaling abort"
581581 ) ;
@@ -606,7 +606,7 @@ async fn shutdown_builder(
606606 }
607607 } else {
608608 info ! (
609- non_critical_task_remaining = inner_jobs . len( ) ,
609+ non_critical_task_remaining = non_critical_tasks . len( ) ,
610610 "No critical tasks remaining, shutting down" ,
611611 ) ;
612612 }
0 commit comments