{"record":{"id":"2ed2ffd04dd7d964","repo":"openai/codex","slug":"telemetry-shutdown-worker-stopped-before-initializ","errorCode":null,"errorMessage":"telemetry shutdown worker stopped before initializing","messagePattern":"telemetry shutdown worker stopped before initializing","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/otel/src/provider.rs","lineNumber":148,"sourceCode":"    }\n\n    fn prepare_shutdown_worker_with_spawner<F>(&mut self, spawn: F) -> io::Result<()>\n    where\n        F: FnOnce(ShutdownWorkerStartup) -> io::Result<std::thread::JoinHandle<()>>,\n    {\n        if self.shutdown_worker.is_some() {\n            return Ok(());\n        }\n\n        let (worker_tx, worker_rx) = mpsc::sync_channel(/*bound*/ 1);\n        let (ready_tx, ready_rx) = mpsc::sync_channel(/*bound*/ 1);\n        let startup = ShutdownWorkerStartup {\n            worker_rx,\n            ready_tx,\n        };\n        let _shutdown_worker = spawn(startup)?;\n        ready_rx.recv().map_err(|_| {\n            io::Error::new(\n                io::ErrorKind::BrokenPipe,\n                \"telemetry shutdown worker stopped before initializing\",\n            )\n        })?;\n        self.shutdown_worker = Some(worker_tx);\n        Ok(())\n    }\n\n    /// Shuts down exporters on a prepared detached thread within a time budget.\n    pub async fn shutdown_with_timeout(mut self, timeout: Duration) -> io::Result<()> {\n        let Some(worker_tx) = self.shutdown_worker.take() else {\n            // Best-effort shutdown must not run a potentially blocking destructor\n            // when its worker could not be prepared.\n            let _provider = ManuallyDrop::new(self);\n            return Err(io::Error::new(\n                io::ErrorKind::NotConnected,\n                \"telemetry shutdown worker was not initialized\",\n            ));","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/otel/src/provider.rs#L130-L166","documentation":"Error \"telemetry shutdown worker stopped before initializing\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/otel/src/provider.rs:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}