@@ -55,6 +55,12 @@ use tokio::sync::oneshot::Sender as OneShotSender;
5555use tokio:: sync:: { Notify , OwnedSemaphorePermit , Semaphore } ;
5656use tonic:: codegen:: { Body , Bytes , StdError } ;
5757
58+ // Maximum time to wait for a free task slot before sending poll_work anyway.
59+ // In pull-based scheduling, poll_work also serves as the heartbeat to the
60+ // scheduler. If we block indefinitely waiting for a free slot, the scheduler
61+ // will declare this executor dead after executor_timeout_seconds.
62+ const SLOT_WAIT_TIMEOUT : Duration = Duration :: from_secs ( 15 ) ;
63+
5864/// Main execution loop that polls the scheduler for available tasks.
5965///
6066/// This function runs indefinitely, periodically asking the scheduler for
@@ -140,12 +146,6 @@ where
140146 let dedicated_executor =
141147 DedicatedExecutor :: new ( "task_runner" , executor. concurrent_tasks ) ;
142148
143- // Maximum time to wait for a free task slot before sending poll_work anyway.
144- // In pull-based scheduling, poll_work also serves as the heartbeat to the
145- // scheduler. If we block indefinitely waiting for a free slot, the scheduler
146- // will declare this executor dead after executor_timeout_seconds.
147- const SLOT_WAIT_TIMEOUT : Duration = Duration :: from_secs ( 15 ) ;
148-
149149 // Track consecutive scheduler connection failures for backoff and log suppression
150150 let mut consecutive_failures: u32 = 0 ;
151151 let mut backoff = ExponentialBackoff {
0 commit comments