From a860462357d7d560f2e25648e211074cc9a03633 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 23 Nov 2026 22:28:33 +0100 Subject: [PATCH] fix: keep NSJAIL_RLIMIT_FSIZE_MB out of the lazy_static block at the recursion limit Co-Authored-By: Claude Opus 5.5 --- backend/windmill-worker/src/worker.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 4c9f8d9704..77902bff6a 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -211,6 +211,15 @@ use windmill_common::bench::{benchmark_init, benchmark_verify, BenchmarkInfo, Be use windmill_common::add_time; +// Kept out of the main block below, which is at the macro recursion limit. +lazy_static::lazy_static! { + /// Override for the nsjail `rlimit_fsize` cap (largest single file a jailed + /// python3/ansible/dbt job may write). MiB, or `unlimited`/`none`/`inf`/`0` to + /// uncap. Unset keeps the historical 1000 MiB. See `render_nsjail_rlimit_fsize`. + pub static ref NSJAIL_RLIMIT_FSIZE_MB: Option = + std::env::var("NSJAIL_RLIMIT_FSIZE_MB").ok(); +} + lazy_static::lazy_static! { pub static ref PY310_CACHE_DIR: String = format!("{}python_3_10", *ROOT_CACHE_DIR); pub static ref PY311_CACHE_DIR: String = format!("{}python_3_11", *ROOT_CACHE_DIR); @@ -397,12 +406,6 @@ lazy_static::lazy_static! { pub static ref NSJAIL_DBT_RLIMIT_AS_MB: Option = std::env::var("NSJAIL_DBT_RLIMIT_AS_MB").ok(); - /// Override for the nsjail `rlimit_fsize` cap (largest single file a jailed - /// python3/ansible/dbt job may write). MiB, or `unlimited`/`none`/`inf`/`0` to - /// uncap. Unset keeps the historical 1000 MiB. See `render_nsjail_rlimit_fsize`. - pub static ref NSJAIL_RLIMIT_FSIZE_MB: Option = - std::env::var("NSJAIL_RLIMIT_FSIZE_MB").ok(); - // pub static ref DISABLE_NSJAIL: bool = false; pub static ref DISABLE_NSJAIL: bool = std::env::var("DISABLE_NSJAIL") .ok()