Repository navigation
fix(proposer): stop session process groups on timeout - #237
Open
OUAO-FRANK wants to merge 1 commit into
Open
OUAO-FRANK wants to merge 1 commit into
OUAO-FRANK wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.