biomejs/biome · error

failed to initialize the global thread pool

Error message

failed to initialize the global thread pool

What it means

Error "failed to initialize the global thread pool" thrown in biomejs/biome.

Source

Thrown at crates/biome_service/src/workspace/server.rs:4631

            }
            Self::Removed => write!(f, "Removed"),
        }
    }
}

/// Sets up the global Rayon thread pool the first time it's called.
///
/// This is used to assign friendly debug names to the threads of the pool.
#[cfg(not(target_family = "wasm"))]
fn init_thread_pool(threads: Option<usize>) {
    static INIT_ONCE: std::sync::Once = std::sync::Once::new();
    INIT_ONCE.call_once(|| {
        rayon::ThreadPoolBuilder::new()
            .thread_name(|index| format!("biome::workspace_worker_{index}"))
            // When zero is passed, rayon decides the number of threads
            .num_threads(threads.unwrap_or(0))
            .build_global()
            .expect("failed to initialize the global thread pool");
    });
}

#[cfg(target_family = "wasm")]
fn init_thread_pool(_threads: Option<usize>) {}

#[cfg(test)]
#[path = "server.tests.rs"]
mod tests;

View on GitHub (pinned to 3835945f06)

Solutions

  1. Check that the process has not exhausted its thread budget when the workspace server starts.
  2. Ensure the global thread pool is initialized only once across the process lifetime.

Example fix

// Inspect the rayon/ThreadPoolBuilder error attached as the source of this error

When it happens

Trigger: Thrown at crates/biome_service/src/workspace/server.rs:4502 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of biomejs/biome@3835945f06 (2026-08-20). Data as JSON: /api/errors/051580d2d811fd97. Report an issue: GitHub.