Skip to content

Terminate timed-out Git process trees - #36793

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/351851708e23ff06b89fe1894bd09a3558f67293
Aug 3, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/351851708e23ff06b89fe1894bd09a3558f67293

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Terminate timed-out Git process trees

Why

Timing out a Git metadata command must not leave helper processes running after
the command wrapper exits.

What changed

  • Run Git metadata commands in a dedicated process group on Unix and a Job
    Object on Windows so timeout cleanup terminates their full process trees.
  • Start Windows commands suspended, assign them to the Job Object, and then
    resume them so immediate descendants cannot escape containment.
  • Preserve descendants when a Git command completes normally, and retain the
    existing direct-spawn fallback if Windows Job Object setup fails.

Testing

Added cross-platform regression tests for cleanup both while the command wrapper
is running and after it exits, plus Windows coverage for immediate-child Job
Object containment.

## Why

Timing out a Git metadata command must not leave helper processes running after
the command wrapper exits.

## What changed

- Run Git metadata commands in a dedicated process group on Unix and a Job
  Object on Windows so timeout cleanup terminates their full process trees.
- Start Windows commands suspended, assign them to the Job Object, and then
  resume them so immediate descendants cannot escape containment.
- Preserve descendants when a Git command completes normally, and retain the
  existing direct-spawn fallback if Windows Job Object setup fails.

## Testing

Added cross-platform regression tests for cleanup both while the command wrapper
is running and after it exits, plus Windows coverage for immediate-child Job
Object containment.

GitOrigin-RevId: 351851708e23ff06b89fe1894bd09a3558f67293
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/351851708e23ff06b89fe1894bd09a3558f67293 branch from c0a318a to 3149fa4 Compare August 3, 2026 20:01
@copyberry
copyberry Bot merged commit 3149fa4 into main Aug 3, 2026
27 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/351851708e23ff06b89fe1894bd09a3558f67293 branch August 3, 2026 20:02
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 3, 2026

This branch was previously deployed

1 inactive deployment
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.

3 participants