pola-rs/polars · error
invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}
Error message
invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x} What it means
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.
Source
Thrown at crates/polars-io/src/cloud/concurrency/mod.rs:137
.max(1);
if init_byte_budget < target_chunk_size {
panic!("in-flight byte budget init must be larger than the target_chunk_size");
}
init_byte_budget
}
/// Maximum number of requests concurrently in flight.
pub fn get_request_budget() -> u64 {
// Since object_store/reqwest use HTTP/1 with a connection pool, this value controls the
// max concurrent TCP sessions to S3 for the pipeline.
// When modifying this value, consider the max_thread count configuration(s), the OS limitations
// (e.g., ulimit -n), and any cloud infrastructure limitations.
std::env::var("POLARS_INFLIGHT_REQUEST_BUDGET")
.map(|x| {
x.parse::<NonZeroU64>()
.unwrap_or_else(|_| panic!("invalid value for POLARS_INFLIGHT_REQUEST_BUDGET: {x}"))
.get()
})
.unwrap_or(512)
.max(1)
}
/// Minimum number of requests concurrently in flight, if demand is there.
pub fn get_floor_request_budget() -> u64 {
// Since object_store/reqwest use HTTP/1 with a connection pool, this value controls the
// max concurrent TCP sessions to S3 for the pipeline.
// When modifying this value, consider the max_thread count configuration(s), the OS limitations
// (e.g., ulimit -n), and any cloud infrastructure limitations.
std::env::var("POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET")
.map(|x| {
x.parse::<NonZeroU64>()
.unwrap_or_else(|_| {
panic!("invalid value for POLARS_INFLIGHT_FLOOR_REQUEST_BUDGET: {x}")
})View on GitHub (pinned to 68506541d2)
Solutions
- Set POLARS_INFLIGHT_REQUEST_BUDGET to a valid positive integer.
- Unset the variable to use the default in-flight request budget.
Defensive patterns
Strategy: validation
When it happens
Trigger: 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.
Common situations: 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.
AI-assisted analysis of pola-rs/polars@68506541d2 (2026-08-19).
Data as JSON: /api/errors/a6f5177b8e9f5e27.
Report an issue: GitHub.