Skip to content

Add a reap-only drop policy for child processes - #47603

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5ec639597dba7f3b61694d6d465991e054ae3397
Sep 23, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5ec639597dba7f3b61694d6d465991e054ae3397

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Add a reap-only drop policy for child processes

What changed

Add a crate-private ChildDropPolicy to choose whether dropping a child kills it or only reaps it after exit. Keep KillAndReap as the default.

For ReapOnly on Unix, transfer dropped children to a shared reaper thread that operates independently of the Tokio runtime. Support both Tokio children and native macOS children, without blocking drop or letting a live child delay reaping others.

Testing

Add an isolated regression test verifying that reap-only children survive handle drop after runtime shutdown, are reaped after exit, and do not prevent other exited children from being reaped.

## What changed

Add a crate-private `ChildDropPolicy` to choose whether dropping a child kills it or only reaps it after exit. Keep `KillAndReap` as the default.

For `ReapOnly` on Unix, transfer dropped children to a shared reaper thread that operates independently of the Tokio runtime. Support both Tokio children and native macOS children, without blocking drop or letting a live child delay reaping others.

## Testing

Add an isolated regression test verifying that reap-only children survive handle drop after runtime shutdown, are reaped after exit, and do not prevent other exited children from being reaped.

GitOrigin-RevId: 5ec639597dba7f3b61694d6d465991e054ae3397
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/5ec639597dba7f3b61694d6d465991e054ae3397 branch from 732b1bf to 897b7ae Compare September 23, 2026 17:59
@copyberry
copyberry Bot merged commit 897b7ae into main Sep 23, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/5ec639597dba7f3b61694d6d465991e054ae3397 branch September 23, 2026 17:59
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 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.

1 participant