From d84c359384ac2af975b86eb0261cdb3f3b30d21e Mon Sep 17 00:00:00 2001 From: Guillaume Bouvignies Date: Fri, 15 Dec 2023 19:16:41 +0100 Subject: [PATCH] chore: Remove slow pull warning in worker agent mode (#2866) --- backend/src/main.rs | 5 ++++- backend/tests/worker.rs | 1 + backend/windmill-queue/src/jobs.rs | 2 +- backend/windmill-worker/src/worker.rs | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index f8d1ee51e8..548c969984 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -330,6 +330,7 @@ Windmill Community Edition {GIT_VERSION} num_workers, base_internal_url.clone(), rsmq.clone(), + mode.clone() == Mode::Agent, ) .await?; tracing::info!("All workers exited."); @@ -499,7 +500,7 @@ Windmill Community Edition {GIT_VERSION} let instance_name = rd_string(8); schedule_stats( instance_name, - mode, + mode.clone(), &db, &HTTP_CLIENT, cfg!(feature = "enterprise"), @@ -571,6 +572,7 @@ pub async fn run_workers, + agent_mode: bool, ) -> anyhow::Result<()> { let instance_name = gethostname() .to_str() @@ -652,6 +654,7 @@ pub async fn run_workers bool; } diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index da2ef355bc..5a495c85ea 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -545,6 +545,7 @@ pub async fn run_worker, _sync_barrier: Arc>>, + agent_mode: bool, ) { #[cfg(not(feature = "enterprise"))] if !*DISABLE_NSJAIL { @@ -1364,7 +1365,7 @@ pub async fn run_worker 0.5 { + if !agent_mode && duration_pull_s > 0.5 { tracing::warn!("pull took more than 0.5s ({duration_pull_s}), this is a sign that the database is VERY undersized for this load. empty: {empty}, err: {err_pull}"); if empty { if let Some(wp) = worker_pull_over_500_counter_empty.as_ref() { @@ -1374,7 +1375,7 @@ pub async fn run_worker 0.1 { + } else if !agent_mode && duration_pull_s > 0.1 { tracing::warn!("pull took more than 0.1s ({duration_pull_s}) this is a sign that the database is undersized for this load. empty: {empty}, err: {err_pull}"); if empty { if let Some(wp) = worker_pull_over_100_counter_empty.as_ref() { @@ -1383,7 +1384,6 @@ pub async fn run_worker