From 2883fc9f8e050abb8ad96599e884e6df394ffe23 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 22 May 2024 13:16:53 +0200 Subject: [PATCH] make drop cache not an error --- backend/windmill-worker/src/worker.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 8639f6c9a9..103a3d0610 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -596,7 +596,7 @@ impl JobCompletedSender { // on linux, we drop caches every DROP_CACHE_PERIOD to avoid OOM killer believing we are using too much memory just because we create lots of files when executing jobs #[cfg(any(target_os = "linux"))] pub async fn drop_cache() { - tracing::debug!("Dropping linux file caches"); + tracing::info!("Syncing and dropping linux file caches to reduce memory usage"); // Run the sync command if let Err(e) = tokio::process::Command::new("sync").status().await { tracing::error!("Failed to run sync command: {}", e); @@ -608,11 +608,11 @@ pub async fn drop_cache() { Ok(mut file) => { // Write '3' to the file to drop caches if let Err(e) = tokio::io::AsyncWriteExt::write_all(&mut file, b"3").await { - tracing::error!("Failed to write to /proc/sys/vm/drop_caches: {}", e); + tracing::warn!("Failed to write to /proc/sys/vm/drop_caches (expected to not work in not in privileged mode, only required to forcefully drop the cache to avoid spurrious oom killer): {}", e); } } Err(e) => { - tracing::error!("Failed to open /proc/sys/vm/drop_caches: {}", e); + tracing::warn!("Failed to open /proc/sys/vm/drop_caches (expected to not work in not in privileged mode, only required to forcefully drop the cache to avoid spurrious oom killer):: {}", e); } } }