Skip to content

Stop owned POSIX descendants after direct script completion - #3644

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
roger-sato:fix/direct-script-exit-cleanup
Oct 20, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
roger-sato:fix/direct-script-exit-cleanup

Conversation

@roger-sato

@roger-sato roger-sato commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a script starts an ordinary POSIX solver with redirected output and exits, run_parallel.py can print PASS all 1 scripts and return while the solver continues running. A failed leader leaves the same leak. Clean up the owned process group before unregistering the completed leader, serialized with the controller's cancellation snapshot. Preserve successful/failed output, exclude unrelated groups, and fail visibly if cleanup fails.

Add five actual-CLI regressions and run them in the existing Ubuntu 3.12 reconciliation workflow. Extend its historical adapter with only the exact new runner hash; the frozen runner, reconciliation manifest and source pins remain unchanged. The new note records reproduction, scope and validation.

Based on canonical main 20ecf2891d80b5acf18d980b2164fb44ea7faa90, priority revision 6. Builds on ywz65's #2676 cancellation correction, its independent #2777 audit, and the isolated-test completed-leader cleanup. This covers normal leader completion; it makes no native Windows, detached-group, execution-deadline or mathematical claim.

Test plan

Local environment: macOS arm64, CPython 3.12.14, Git 2.54.0.

  • python3.12 -W error -B -m unittest discover -s tests -p 'test_script_exit_cleanup.py' -v: all 5 pass; the original runner fails 3. Covers children/grandchildren, unrelated-process survival, success/failure output and an already-joined group. Parent-only cleanup mutation is detected; injected signal denial rejects success and preserves retry diagnostics.
  • python3.12 -O -W error -B -m unittest discover -s tests -p 'test_script_exit_cleanup.py' -v: all 5 pass.
  • Exact added workflow command, python3.12 -W error -B -m unittest discover -s tests -p 'test_script_*.py' -v: 14 tests, 5 pass and 9 existing Linux/Windows observers skip on macOS.
  • Existing cancellation/parallel/assertion/memory modules: 30 tests, 20 pass and 10 platform skips; exact bounded suite command is in the note. Independent thread/lock race controls verify both cleanup ownership orders stop once and retain the original exception.
  • Actual python3.12 -B scripts/replay_historical_check.py reconciliation92 in its complete 383-file closure passes 92 pinned trees / 4,564 distinct blobs. Unknown live runner and corrupted frozen input both reject; original manifest and sources stay exact.
  • python3.12 -B scripts/research_package.py --package research/isolated-test-bytecode and --package research/isolated-descendant-bytecode: every registered command passes; declared outcomes remain completed / partial.
  • git diff --check.
  • python3.12 -B scripts/research_package.py --package research/historical-snapshot-one-pass has an unchanged baseline failure: 27 tests, 1 failure + 1 error, both from the unrelated tooling-ledger guard for docs/ci-verification.md. The same result is reproduced with the actual registered CLI over 82 files read exactly from canonical main. No unrelated hash admission was added. Fork-hosted results are recorded below; upstream approval is separate.

Hosted verification reviewed on 2026-10-18

  • Fork-hosted Ubuntu 24.04.5 / CPython 3.12.15 replay at exact commit 58a754bf08ce63080822a28451aaa4952e2f6e2a: reconciliation92 workflow passes 92 pinned trees / 4,564 distinct blobs, all 6 worker-isolation tests and all 14 direct-script tests (including all 5 new regressions, no platform skips). The passing test process emitted ignored resource-finalization warnings in the existing cancellation controls; this is not a warning-free run.
  • The separate Community exact tooling run passes tooling-exact and the scoped owner/provenance diagnostics, then stops at the known docs/ci-verification.md successor guard addressed by #3648. Subsequent historical/reconciliation tests and the tracked-diff step were not reached. This does not establish that the complete tooling workflow passes after that correction.

These are completed fork workflow results, not upstream maintainer approval or a mathematical replay.

Prepared for roger-sato with substantial OpenAI Codex assistance; independently reviewed with AI assistance. Apache-2.0.

出力を閉じた子プロセスが残っていても成功を報告していたため、
POSIX グループの後始末とキャンセル時の所有権を同期する。
実 CLI 回帰テスト、CI 経路、凍結ソースを保持する履歴アダプターを追加する。
@roger-sato
roger-sato marked this pull request as ready for review October 18, 2026 12:43
@Mister-Meeseeks
Mister-Meeseeks merged commit eae5700 into CrocSwap:main Oct 20, 2026
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.

2 participants