{"record":{"id":"a5e85e53ac47c872","repo":"tikv/tikv","slug":"unable-to-create-tso-worker-thread","errorCode":null,"errorMessage":"unable to create tso worker thread","messagePattern":"unable to create tso worker thread","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"components/pd_client/src/tso.rs","lineNumber":78,"sourceCode":"        call_option: CallOption,\n    ) -> Result<TimestampOracle> {\n        let (request_tx, request_rx) = mpsc::channel(MAX_BATCH_SIZE);\n        let (rpc_sender, rpc_receiver) = pd_client.tso_opt(call_option)?;\n        let (close_tx, close_rx) = watch::channel(());\n\n        // Start a background thread to handle TSO requests and responses\n        thread::Builder::new()\n            .name(TSO_WORKER_THREAD.to_string())\n            .spawn_wrapper(move || {\n                block_on(run_tso(\n                    cluster_id,\n                    rpc_sender.sink_err_into(),\n                    rpc_receiver.err_into(),\n                    request_rx,\n                    close_tx,\n                ))\n            })\n            .expect(\"unable to create tso worker thread\");\n\n        Ok(TimestampOracle {\n            request_tx,\n            close_rx,\n        })\n    }\n\n    pub(crate) fn get_timestamp(\n        &self,\n        count: u32,\n    ) -> impl Future<Output = Result<TimeStamp>> + 'static {\n        let (request, response) = oneshot::channel();\n        let request_tx = self.request_tx.clone();\n        async move {\n            request_tx\n                .send(TimestampRequest {\n                    sender: request,\n                    count,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/tikv/tikv/blob/78aedc1c81ef3f7d8bacc6e9d09f56460f134937/components/pd_client/src/tso.rs#L60-L96","documentation":"TimestampOracle construction spawns the dedicated TSO worker thread via thread::Builder; the spawn failed (thread/resource limits, e.g. RLIMIT_NPROC or memory), so the panic fires on the unwrap. The input at fault is the process's ability to create a new named thread at TSO client startup.","triggerScenarios":"Thrown at components/pd_client/src/tso.rs:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise thread/memory limits for the TiKV process or host","Reduce other process thread pressure and retry startup"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78aedc1c81ef3f7d8bacc6e9d09f56460f134937","analyzedAt":"2026-09-03T23:31:32.398Z","contentChangedAt":"2026-09-03T23:31:32.398Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}