Skip to content

Fall back to per-process MCP cleanup on macOS - #37068

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/db722475b94dece74244ce8109b3e92f6cfb202a
Aug 5, 2026
Merged

Fall back to per-process MCP cleanup on macOS#37068
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/db722475b94dece74244ce8109b3e92f6cfb202a

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 5, 2026

Copy link
Copy Markdown

Fall back to per-process MCP cleanup on macOS

Why

Signaling an MCP server's process group can fail with EPERM on macOS,
preventing owned descendants from being terminated.

What changed

  • When a group signal is denied, enumerate the group's processes and signal
    members that still belong to the expected process group.
  • Apply the fallback to both SIGTERM and SIGKILL during MCP stdio server
    cleanup, while retaining the existing group signaling behavior elsewhere.
  • Reject invalid process group IDs and avoid signaling processes that have
    moved to another group.

Testing

Added macOS tests covering cleanup with a live or exited group leader,
SIGTERM-resistant descendants, escalation to SIGKILL, and unsafe group IDs.

## Why

Signaling an MCP server's process group can fail with `EPERM` on macOS,
preventing owned descendants from being terminated.

## What changed

- When a group signal is denied, enumerate the group's processes and signal
  members that still belong to the expected process group.
- Apply the fallback to both `SIGTERM` and `SIGKILL` during MCP stdio server
  cleanup, while retaining the existing group signaling behavior elsewhere.
- Reject invalid process group IDs and avoid signaling processes that have
  moved to another group.

## Testing

Added macOS tests covering cleanup with a live or exited group leader,
`SIGTERM`-resistant descendants, escalation to `SIGKILL`, and unsafe group IDs.

GitOrigin-RevId: db722475b94dece74244ce8109b3e92f6cfb202a
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/db722475b94dece74244ce8109b3e92f6cfb202a branch from a55e408 to f2d8255 Compare August 5, 2026 09:44
@copyberry
copyberry Bot merged commit f2d8255 into main Aug 5, 2026
29 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/db722475b94dece74244ce8109b3e92f6cfb202a branch August 5, 2026 09:45
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants