prevent forever loops nit

This commit is contained in:
Ruben Fiszel
2025-07-15 15:36:42 +00:00
parent 2e1b6c1947
commit d3a05d495d
+7
View File
@@ -2317,6 +2317,9 @@ pub async fn pull(
tracing::warn!("Pull job loop count: {}", pull_loop_count);
tokio::task::yield_now().await;
}
if pull_loop_count > 1000 {
return Ok(PulledJobResult { job: None, suspended: false });
}
if let Some((query_suspended, query_no_suspend)) = query_o {
let njob = {
let job = if query_suspended.is_empty() {
@@ -2523,6 +2526,10 @@ pub async fn pull(
tracing::warn!("Window finding job loop count: {}", pull_loop_count);
tokio::task::yield_now().await;
}
if i > 1000000000 {
tracing::error!("Window finding job loop count exceeded 1000000000, breaking");
break;
}
}
tracing::info!("Job '{}' from path '{}' with concurrency key '{}' has reached its concurrency limit of {} jobs run in the last {} seconds. This job will be re-queued for next execution at {} (min_started_at: {min_started_at_or_now}, avg script duration: {:?}, number of time windows full: {})",