Skip to content

exec: timeout on grandchildren - #1852

Closed
md-oai wants to merge 4 commits into
mainfrom
kill-grandchildren
Closed

md-oai wants to merge 4 commits into
mainfrom
kill-grandchildren

Conversation

@md-oai

@md-oai md-oai commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

We were enforcing the 10 s wall-clock limit only on the child process. If that child (bash) spawns grandchildren and we kill it on timeout, those grandchildren still have the original stdout/err pipe open, so the background tasks that are draining the pipes block forever

md-oai added 2 commits August 5, 2025 08:48
We were enforcing the 10 s wall-clock limit only on the child process.
If that child (bash) spawns grandchildren and we kill it on timeout, those
grandchildren still have the original stdout/err pipe open, so the background
tasks that are draining the pipes block forever
We were enforcing the 10 s wall-clock limit only on the child process.
If that child (bash) spawns grandchildren and we kill it on timeout, those
grandchildren still have the original stdout/err pipe open, so the background
tasks that are draining the pipes block forever
@md-oai
md-oai requested a review from bolinfest August 5, 2025 18:35
Comment thread codex-rs/core/src/exec.rs Resolved
We were enforcing the 10 s wall-clock limit only on the child process.
If that child (bash) spawns grandchildren and we kill it on timeout, those
grandchildren still have the original stdout/err pipe open, so the background
tasks that are draining the pipes block forever
@etraut-openai

Copy link
Copy Markdown
Contributor

@md-oai, I presume this PR is stale and no longer relevant? I wanted to confirm before closing.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2025
@etraut-openai etraut-openai reopened this Nov 13, 2025
@openai openai unlocked this conversation Nov 13, 2025
@etraut-openai etraut-openai added needs-response Additional information is requested and removed oai-pr needs-response Additional information is requested labels Nov 13, 2025
@etraut-openai

Copy link
Copy Markdown
Contributor

This PR has gone stale. Rather than attempting to revive it, I've copied the fix into a new PR and added an integration test. Closing this PR once again.

etraut-openai added a commit that referenced this pull request Nov 13, 2025
…tdout (#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
willy3087 pushed a commit to nextlw/elai_codex that referenced this pull request Nov 14, 2025
…tdout (openai#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
takumi-earth pushed a commit to earthlings-dev/codex that referenced this pull request Dec 2, 2025
…tdout (openai#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
monkeycode-ai Bot pushed a commit to agogo233/Ecode that referenced this pull request Jun 8, 2026
…tdout (#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai/codex#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai/codex#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
…tdout (openai#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
wangjiecloud pushed a commit to wangjiecloud/codex that referenced this pull request Jun 27, 2026
…tdout (openai#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
shafqatevo pushed a commit to alo-labs/kay that referenced this pull request Aug 7, 2026
…tdout (#6575)

We've received many reports of codex hanging when calling certain tools.
[Here](openai/codex#3204) is one example. This
is likely a major cause. The problem occurs when
`consume_truncated_output` waits for `stdout` and `stderr` to be closed
once the child process terminates. This normally works fine, but it
doesn't handle the case where the child has spawned grandchild processes
that inherits `stdout` and `stderr`.

The fix was originally written by @md-oai in [this
PR](openai/codex#1852), which has gone stale.
I've copied the original fix (which looks sound to me) and added an
integration test to prevent future regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants