{"record":{"id":"427bf1897d30a0ff","repo":"openai/codex","slug":"cancelsynchronousio-failed-for-runner-pipe-label","errorCode":null,"errorMessage":"CancelSynchronousIo failed for runner {pipe_label} connect thread: {err}","messagePattern":"CancelSynchronousIo failed for runner (.+?) connect thread: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs","lineNumber":266,"sourceCode":"            if let Some(connect_thread) = connect_thread.take() {\n                let _ = connect_thread.join();\n            }\n            result\n        }\n        Err(mpsc::RecvTimeoutError::Timeout) => {\n            if let Some(result) = try_take_completed_connect_result(\n                &mut connect_thread,\n                &connect_result_rx,\n                thread_handle,\n                &pipe_label,\n            )? {\n                result\n            } else {\n                let cancel_ok = unsafe { CancelSynchronousIo(thread_handle) };\n                if cancel_ok == 0 {\n                    let err = unsafe { GetLastError() };\n                    if err != ERROR_NOT_FOUND {\n                        Err(anyhow::anyhow!(\n                            \"CancelSynchronousIo failed for runner {pipe_label} connect thread: {err}\"\n                        ))\n                    } else if let Some(result) = try_take_completed_connect_result(\n                        &mut connect_thread,\n                        &connect_result_rx,\n                        thread_handle,\n                        &pipe_label,\n                    )? {\n                        result\n                    } else {\n                        Err(anyhow::anyhow!(\n                            \"timed out after {}ms connecting runner {pipe_label}\",\n                            RUNNER_PIPE_CONNECT_TIMEOUT.as_millis()\n                        ))\n                    }\n                } else {\n                    // Do not join the helper thread on the timeout path. Parent-side cleanup will\n                    // close the pipe handles, which lets the blocked connect unwind without","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs#L248-L284","documentation":"Error \"CancelSynchronousIo failed for runner {pipe_label} connect thread: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs:266 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"}