{"record":{"id":"051580d2d811fd97","repo":"biomejs/biome","slug":"failed-to-initialize-the-global-thread-pool","errorCode":null,"errorMessage":"failed to initialize the global thread pool","messagePattern":"failed to initialize the global thread pool","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_service/src/workspace/server.rs","lineNumber":4631,"sourceCode":"            }\n            Self::Removed => write!(f, \"Removed\"),\n        }\n    }\n}\n\n/// Sets up the global Rayon thread pool the first time it's called.\n///\n/// This is used to assign friendly debug names to the threads of the pool.\n#[cfg(not(target_family = \"wasm\"))]\nfn init_thread_pool(threads: Option<usize>) {\n    static INIT_ONCE: std::sync::Once = std::sync::Once::new();\n    INIT_ONCE.call_once(|| {\n        rayon::ThreadPoolBuilder::new()\n            .thread_name(|index| format!(\"biome::workspace_worker_{index}\"))\n            // When zero is passed, rayon decides the number of threads\n            .num_threads(threads.unwrap_or(0))\n            .build_global()\n            .expect(\"failed to initialize the global thread pool\");\n    });\n}\n\n#[cfg(target_family = \"wasm\")]\nfn init_thread_pool(_threads: Option<usize>) {}\n\n#[cfg(test)]\n#[path = \"server.tests.rs\"]\nmod tests;\n","sourceCodeStart":4613,"sourceCodeEnd":4641,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/crates/biome_service/src/workspace/server.rs#L4613-L4641","documentation":"Error \"failed to initialize the global thread pool\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_service/src/workspace/server.rs:4502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the process has not exhausted its thread budget when the workspace server starts.","Ensure the global thread pool is initialized only once across the process lifetime."],"exampleFix":"// Inspect the rayon/ThreadPoolBuilder error attached as the source of this error","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3835945f0638c88162351318b7bc8b64c5f2fba7","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}