{"record":{"id":"ac0e1a555f21ee0c","repo":"openai/codex","slug":"pid-managed-updater-shutdown-is-unsupported-on-thi","errorCode":null,"errorMessage":"pid-managed updater shutdown is unsupported on this platform","messagePattern":"pid-managed updater shutdown is unsupported on this platform","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-daemon/src/backend/pid.rs","lineNumber":573,"sourceCode":"    if err.raw_os_error() == Some(libc::ESRCH) {\n        return Ok(());\n    }\n    Err(err).with_context(|| format!(\"failed to force terminate pid-managed updater group {pid}\"))\n}\n\n#[cfg(not(unix))]\nfn terminate_process(_pid: u32) -> Result<()> {\n    bail!(\"pid-managed app-server shutdown is unsupported on this platform\")\n}\n\n#[cfg(not(unix))]\nfn force_terminate_process(_pid: u32) -> Result<()> {\n    bail!(\"pid-managed app-server shutdown is unsupported on this platform\")\n}\n\n#[cfg(not(unix))]\nfn force_terminate_process_group(_pid: u32) -> Result<()> {\n    bail!(\"pid-managed updater shutdown is unsupported on this platform\")\n}\n\n#[cfg(unix)]\nasync fn process_matches_record(record: &PidRecord) -> Result<bool> {\n    if !process_exists(record.pid) {\n        return Ok(false);\n    }\n\n    match read_process_start_time(record.pid).await {\n        Ok(start_time) => Ok(start_time == record.process_start_time),\n        Err(_err) if !process_exists(record.pid) => Ok(false),\n        Err(err) => Err(err),\n    }\n}\n\n#[cfg(not(unix))]\nasync fn process_matches_record(_record: &PidRecord) -> Result<bool> {\n    Ok(false)","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-daemon/src/backend/pid.rs#L555-L591","documentation":"The pid update loop ('app-server daemon pid-update-loop', see command_args at pid.rs:421) is spawned with setsid and torn down by killing its whole process group via kill(-pid, SIGKILL) on Unix. On non-Unix targets this group-kill stub bails unconditionally. It is reached through PidBackend::force_terminate_process when command_kind is PidCommandKind::UpdateLoop (pid.rs:445-449).","triggerScenarios":"Stopping or restarting the managed updater on a non-Unix build; any test driving update-loop teardown on Windows. The Unix twin at pid.rs:547 sends SIGKILL to the process group and treats ESRCH as success, never yielding this message.","commonSituations":"Update-loop lifecycle invoked on Windows hosts; cross-platform tooling assuming process-group semantics; CI on non-Unix runners touching updater teardown code.","solutions":["Run the updater lifecycle on a Unix platform — process groups (setsid + kill(-pid)) are POSIX-only.","Route through the public run_pid_update_loop()/run() APIs so ensure_supported_platform rejects non-Unix first.","cfg-gate updater teardown call sites with #[cfg(unix)] and degrade gracefully elsewhere.","Don't port the group-kill expectation to Windows; there is no equivalent stub-free path in this crate."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if !cfg!(unix) {\n    anyhow::bail!(\"updater process-group shutdown requires Unix\");\n}","typeGuard":null,"tryCatchPattern":"None — unconditional bail on non-Unix. Prevent at dispatch with a platform check instead of catching downstream.","preventionTips":["Keep update-loop teardown code behind #[cfg(unix)].","Never assume kill(-pid) semantics exist outside POSIX.","Smoke-test updater stop on every platform you ship to."],"tags":["rust","codex","daemon","platform-support","windows","process-group","updater"],"backgroundTag":"unsupported-platform","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}