Skip to content

fix(proposer): stop session process groups on timeout - #237

Open
OUAO-FRANK wants to merge 1 commit into
google-research:mainfrom
OUAO-FRANK:codex/issue-236-proposer-timeout-process-group
Open

OUAO-FRANK wants to merge 1 commit into
google-research:mainfrom
OUAO-FRANK:codex/issue-236-proposer-timeout-process-group

Conversation

@OUAO-FRANK

Copy link
Copy Markdown
Contributor

Problem

The proposer channels use subprocess.run with a timeout. On POSIX the direct CLI is terminated, but descendants it started can remain alive after the failed attempt returns, releases its concurrency slot and removes its session workspace. Those children can continue work during subsequent attempts.

Change

Run each POSIX proposer session in its own process group, kill that group on TimeoutExpired, drain its pipes and reap the direct child before propagating the timeout. Both proposer channels use the private launcher. Preserve stdin delivery and normal stdout/stderr/exit-code collection; non-POSIX behavior retains subprocess.run. One existing isolation test now patches the launcher boundary.

Fixes #236.

Validation

Linux, Python3.12.3, base6868817:

  • python3 -m unittest discover -s tests -v:72 tests pass on this independent branch.
  • Real descendant-process regression plus successful stdin control:3 consecutive focused runs pass. Exact original implementation restores both timeout failures, while the stdin control passes.
  • Temporary combination with#235 applies cleanly and passes all75 tests; final proposer-focused suite12 tests passes after mutation validation.
  • ruff check harness2 tests; ruff format --check harness2/core/proposer.py tests/test_workflow.py tests/test_proposer_timeout.py; python3 -m compileall -q harness2 tests; git diff --check:pass.

The regression starts a real local child with separate stdio that would write a marker after the one-second parent timeout. Before the fix both channels' children write the marker; after the fix neither does. The test cleans its own recorded child PIDs. These are offline executables, not model or remote executor calls. Only descendants remaining in the session process group are covered; no claim of containing deliberately daemonized processes.

This is independent of#235's completed-process exit-status check, and this branch does not contain that change. Open#183 addresses timeout spend; this PR does not change timeout cost accounting or the TimeoutExpired partial-output contract.

AI assistance: OpenAI Codex investigated, implemented and tested this change and drafted this description. No live provider incident or human review by the account holder is claimed.

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.

Timed-out proposer sessions leave descendant processes running

1 participant