Repository navigation
Clean up POSIX verification subprocesses on SIGTERM - #4975
Merged
Mister-Meeseeks merged 3 commits intoOct 23, 2026
Merged
Conversation
Contributor
Independent review at head
|
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.
SIGTERM sent to either POSIX verification owner can terminate the owner while its separately grouped module and solver keep running. A readiness-controlled baseline fixture observes both descendants still alive after owner exit
-15. Existing timeout and KeyboardInterrupt cleanup do not run for default SIGTERM.This change temporarily handles default SIGTERM during main-thread calls to
research_package.run_commandandrun_isolated_tests.run_modules, then uses their existing process-group cleanup. A normal handled termination exits 143, restores the previous handler and never reports verification success. The registered path covers Python replay and optional dependency-install commands; the isolated path retains result order and queued-work cancellation. Custom/ignored handlers, worker-thread invocation and Windows ownership retain their existing behavior.Launch/assignment and cleanup only record pending termination. Asynchronous cancellation is permitted only inside a wait protected by an inner
finally. A signal before Popen returns therefore cannot lose its spawned handle; the isolated workers retain the existing launch/registration lock. Repeated SIGTERM cannot interrupt cleanup. If an ordinary exception has already entered cleanup, the first SIGTERM is deferred and the original exception remains the failure. This closes a distinct cancellation boundary beyond #2625/#2676, #2906, #4683 and #4779. Detached sessions and SIGKILL remain outside scope.Validation on macOS 27 arm64 / CPython 3.12.2:
isolated-test-bytecodeandisolated-descendant-bytecoderegistered hooks pass in 7.995 s / 24.085 s. The standalone copied-runner boundary remains supported; no new helper import is required.git diff --checkpasses. Three meaningful commits retain the regression, root repair and scope/evidence note; every author and committer is JoyboyBrian.The new
test_research_posix_sigterm.pyis included by existing Ubuntu onboarding CI. At exact head7cffe39596aae05003391f22a4a9c452501b27ae, Ubuntu onboarding job120251366422 passed on Ubuntu 24.04.5 / CPython 3.12.15: all eleven new SIGTERM methods passed with native pidfd lifetime observations, and the complete onboarding suite passed 373 tests with eleven platform skips. The downstream full archive CI remains unverified. Changing sharedscripts/research_package.pymakes the actual planner select all 2,851 opted-in packages at this base; those historical/scientific packages were not replayed locally. The separately inspectedisolated-runner-successormetadata still rejects its unchanged historicalcertificates/selected-result.jsonpin before replay. No frozen pin, acceptance list, selected record or mathematical claim is changed, and full archive CI is not claimed green.Base: canonical
b91956876e5b4122fd89179f1b57557ff8378f15, priority revision 7. Exact commands, source hashes, signal/exit-status contract and open obligations are indocs/research/posix-sigterm-cleanup.md. Canonical claim and investigation.Entry overlap checkpoint: complete 317 open PRs at 2026-10-23 04:46:31 UTC, 4,064 Discussion records at 04:47:21 UTC, and all 6,636 local notes. The portable-replay card and explicit runner/export/SIGTERM/cancellation terms found credited predecessors, but no matching default-SIGTERM repair in this coverage. Offline-staleness and unreviewed-discussion limitations remain; final submission refresh is recorded separately.
Credit Paul Romeo, yssite, ywz65, Nick Petalas, Mihir Srivastava, Douglas Colkitt and retained lifecycle/source contributors. Prepared by JoyboyBrian with substantial OpenAI Codex assistance; author-process agent review is not independent human/formal verification. Apache-2.0. No new kappa or selected-frontier change.
Final submission checkpoint: canonical main refreshed at 04:59 UTC remains
b91956876e5b4122fd89179f1b57557ff8378f15; governing guidance and affected inputs are unchanged. Complete refreshed overlap covers 318 open PRs (04:59:29 UTC), 4,077 discussion records (05:00:22 UTC) and 6,636 current-base notes. The scoped SIGTERM query finds only this claim and its index; live Discussion1472 was read again before submission. This coverage does not prove novelty. A separate coordinating Codex review checked the production diff and documentation, including an exceptional-cleanup race which is covered by the final regression.CI follow-up for exact head
7cffe39596aae05003391f22a4a9c452501b27ae: archive CI is failing and unfinished. The frozen 2026-10-23 05:35:17 UTC snapshot contained 257 currently emitted checks: 38 successful, 11 failed, 208 pending. This is not completion of all 2,851 selected packages. The Ubuntu plan job passed all eleven new SIGTERM methods; its full onboarding group ran 373 tests with 11 skips on Ubuntu 24.04.5 / CPython 3.12.15.Each of the eleven failed logs in that frozen snapshot was inspected and compared with exact canonical base
b91956876e5b4122fd89179f1b57557ff8378f15:docs/research/pr-intake-decisions.json--check-only: same rejectioncertificates/selected-result.json--check-only: same rejectioncertificates/selected-result.json--check-only: same rejectioncertificates/selected-result.json--check-only: same rejectioncertificates/selected-result.json--check-only: same rejectionpackage-local selected-result hash guardpackage-local selected-result hash guardcertificates/selected-result.json--check-only: same rejectiondocs/research/pr-intake-decisions.json--check-only: same rejectionpackage-local selected-result hash guardcertificates/selected-result.json--check-only: same rejectionThe eight metadata failures reproduce with the original base
scripts/research_package.py, base package metadata and base source bytes, using--check-only. Foradaptive-witness-retune,a5-conjugate-any-registersandbidirectional-connector,--check-onlypasses at both revisions; their own unchanged verifier/caller separately treats historical selected-result provenance as a live hash. Executing only those exact source-authentication guards from the base reproduces their logged exceptions. Their scientific routines were not rerun locally. All eleven relevant verifier/caller and metadata files, and both mismatched source targets, are byte-identical between base and this PR. These eleven inspected causes therefore predate this change; pending or subsequently completed archive jobs have not been triaged. No full archive success or baseline scientific replay is claimed. Frozen pins remain unchanged.