{"record":{"id":"a6f5177b8e9f5e27","repo":"pola-rs/polars","slug":"invalid-value-for-polars-inflight-request-budget","errorCode":null,"errorMessage":"invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}","messagePattern":"invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-io/src/cloud/concurrency/mod.rs","lineNumber":137,"sourceCode":"        .max(1);\n\n    if init_byte_budget < target_chunk_size {\n        panic!(\"in-flight byte budget init must be larger than the target_chunk_size\");\n    }\n\n    init_byte_budget\n}\n\n/// Maximum number of requests concurrently in flight.\npub fn get_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_REQUEST_BUDGET\")\n        .map(|x| {\n            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                })","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-io/src/cloud/concurrency/mod.rs#L119-L155","documentation":"Panics in get_request_budget() when POLARS_INFLIGHT_REQUEST_BUDGET cannot be parsed as a NonZeroU64. The value bounds concurrent in-flight requests (TCP sessions to object storage); the panic fires only on an invalid user-supplied env string, otherwise the default of 512 applies.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}\". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}\"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.","solutions":["Set POLARS_INFLIGHT_REQUEST_BUDGET to a valid positive integer.","Unset the variable to use the default in-flight request budget."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}