openai/codex · error · std::io::Error

telemetry shutdown worker stopped before initializing

Error message

telemetry shutdown worker stopped before initializing

What it means

Error "telemetry shutdown worker stopped before initializing" thrown in openai/codex.

Source

Thrown at codex-rs/otel/src/provider.rs:148

    }

    fn prepare_shutdown_worker_with_spawner<F>(&mut self, spawn: F) -> io::Result<()>
    where
        F: FnOnce(ShutdownWorkerStartup) -> io::Result<std::thread::JoinHandle<()>>,
    {
        if self.shutdown_worker.is_some() {
            return Ok(());
        }

        let (worker_tx, worker_rx) = mpsc::sync_channel(/*bound*/ 1);
        let (ready_tx, ready_rx) = mpsc::sync_channel(/*bound*/ 1);
        let startup = ShutdownWorkerStartup {
            worker_rx,
            ready_tx,
        };
        let _shutdown_worker = spawn(startup)?;
        ready_rx.recv().map_err(|_| {
            io::Error::new(
                io::ErrorKind::BrokenPipe,
                "telemetry shutdown worker stopped before initializing",
            )
        })?;
        self.shutdown_worker = Some(worker_tx);
        Ok(())
    }

    /// Shuts down exporters on a prepared detached thread within a time budget.
    pub async fn shutdown_with_timeout(mut self, timeout: Duration) -> io::Result<()> {
        let Some(worker_tx) = self.shutdown_worker.take() else {
            // Best-effort shutdown must not run a potentially blocking destructor
            // when its worker could not be prepared.
            let _provider = ManuallyDrop::new(self);
            return Err(io::Error::new(
                io::ErrorKind::NotConnected,
                "telemetry shutdown worker was not initialized",
            ));

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/otel/src/provider.rs:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/2ed2ffd04dd7d964. Report an issue: GitHub.