{"record":{"id":"e5e2eb9da1c5dd8a","repo":"pola-rs/polars","slug":"invalid-value-for-polars-inflight-floor-request-bu","errorCode":null,"errorMessage":"invalid value for POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET: {x}","messagePattern":"invalid value for POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/cloud/concurrency/mod.rs","lineNumber":154,"sourceCode":"            x.parse::<NonZeroU64>()\n                .unwrap_or_else(|_| panic!(\"invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}\"))\n                .get()\n        })\n        .unwrap_or(512)\n        .max(1)\n}\n\n/// Minimum number of requests concurrently in flight, if demand is there.\npub fn get_floor_request_budget() -> u64 {\n    // Since object_store/reqwest use HTTP/1 with a connection pool, this value controls the\n    // max concurrent TCP sessions to S3 for the pipeline.\n    // When modifying this value, consider the max_thread count configuration(s), the OS limitations\n    // (e.g., ulimit -n), and any cloud infrastructure limitations.\n    std::env::var(\"POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET\")\n        .map(|x| {\n            x.parse::<NonZeroU64>()\n                .unwrap_or_else(|_| {\n                    panic!(\"invalid value for POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET: {x}\")\n                })\n                .get()\n        })\n        .unwrap_or(polars_config::config().max_threads() as u64)\n        .max(1)\n}\n\n/// Windowed round-trip time of 0-byte metadata (HEAD) requests.\n/// Diagnostic only, not to be used for BDP estimation.\n#[derive(Debug)]\npub struct HeadRttChannel {\n    min_ns: AtomicU64,\n    sum_ns: AtomicU64,\n    count: AtomicU64,\n    /// Never reset, unlike `count`: distinguishes the first request of the process from\n    /// the first of a window.\n    total: AtomicU64,\n}","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-io/src/cloud/concurrency/mod.rs#L136-L172","documentation":"Polars parses POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET as a NonZeroU64 to set the minimum number of concurrent requests maintained during adaptive pacing (default: max_threads). A set-but-unparseable value triggers this panic at initialization. It is a strict configuration validation to avoid a floor of zero requests.","triggerScenarios":"Setting POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET to anything NonZeroU64 cannot parse: 'auto', '8.0', '0', negative values, empty string, or values overflowing u64.","commonSituations":"Treating the value as a float ('8.0') when tuning concurrency; zeroing it hoping to pause downloads; locale or whitespace contamination when generated by templating tools like Helm or envsubst.","solutions":["Set the variable to a plain positive integer, e.g. 8 (not 8.0).","Unset it to use the default derived from Polars max_threads configuration.","Strip whitespace/quotes in the originating template or entrypoint script before export.","Check that no earlier process in the container chain exports a bad value (`env` in the failing process)."],"exampleFix":"// before\nexport POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET=8.0\n// after\nexport POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET=8","handlingStrategy":"validation","validationCode":"const v = process.env.POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET;\nif (v !== undefined && (!/^[1-9]\\d*$/.test(v.trim()) || BigInt(v) > 18446744073709551615n)) {\n  throw new Error(`POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET must be a positive integer, got: ${JSON.stringify(v)}`);\n}","typeGuard":"const isValidFloorBudget = (v) => typeof v === 'string' && /^[1-9]\\d*$/.test(v.trim());","tryCatchPattern":null,"preventionTips":["Use integers, never floats like 8.0.","Beware templating tools (Helm/envsubst) injecting quoted or empty values — validate after render.","Omit the variable to use the max_threads-derived default."],"tags":["rust","env-var","configuration","panic","cloud-io"],"backgroundTag":"invalid-env-var-value","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}