fix(tools): wait for macOS replay process groups to disappear #27860
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27860"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by mcarkade on 2026-11-27T15:48:05Z.
What
On macOS, a replay process group can still exist after
SIGKILLwhile its last members are being reaped. Darwin can returnEPERMfor a zero-signal probe of that group. The minimizer reported cleanup failure immediately in both descendant lifecycle cases on #27690. Failing macOS job · Darwin signal handlingKeep probing within the existing cleanup deadline on macOS. Cleanup succeeds once the group disappears. A denied initial kill or a group that is still present at the deadline remains a cleanup error.
Tested
git diff --checkpassed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by arcwiser on 2026-11-27T15:51:28Z.
Review: APPROVED
Reviewed exact head
dde92d5b1734c659b0c67cd14ea5d374b8cacb43.I inspected the complete two-file diff and the surrounding process-group cleanup paths. Apple XNU's
killpg1can find the process group, filter exited members from iteration, and then returnEPERMwhen the POSIX probe finds no signalable member; treating DarwinEPERMas “still present” and continuing the existing bounded probe is consistent with that behavior. The initialSIGKILLpermission failure remains fatal, non-DarwinPermissionErrorstill fails immediately, and persistent Darwin denial still fails closed at the deadline.Independent checks on Windows:
tools/check_conventions.py --base upstream/main: passed;git diff --check: passed.I could not reproduce the native Darwin process-state transition locally, but the implementation is bounded and the PR links a successful native macOS run covering both descendant-cleanup cases. I found no blocking issue.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T16:07:37Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
dde92d5b1734c659b0c67cd14ea5d374b8cacb43retries Darwin process-group probes afterPermissionErroruntil the group disappears or the cleanup deadline expires; no blocking defects were found in the changed code.What I ran
Read the prepared description, commit list, manifest, diff, and both changed files through
repo_read.py. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports passing replay lifecycle and minimizer suites on macOS, Windows, and Ubuntu WSL, and a passing
git diff --check; these results were not independently verified. No files were excluded from the manifest, and both reviewed files were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-27T16:55:31Z.
Review: COMMENTED
I checked the exact PR head and its parent with eight simulated signal/readback sequences on Linux Python. The updated Darwin path drains successfully after a transient permission denial, including when a mixed sequence of successful and denied probes ends with the group disappearing at the deadline. Persistent denial reaches the existing deadline and still reports a cleanup error.
The initial denied group kill still takes the root-only fallback and reports an error, a timeout while waiting for the root still fails before any group probe, and Linux still reports a denied probe immediately. All process and clock operations in this comparison were mocked.
Imported from boykopovar/AnyPS5. Originally posted by NobleBrains on 2026-11-30T13:52:18Z.
Review: APPROVED
Looks good. Reviewed head
dde92d5b1734c659b0c67cd14ea5d374b8cacb43: read both changed files' diff and ran the tests natively on macOS (15.7.9, Apple M4, Python 3.14.7).test_frame_capture_minimize_replay.py, 100 runs per row. "Old" is the PR's tests withtools/frame_capture_minimize.pyfrom the merge base:yesprocessestest_owned_descendant_is_drained_after_parent_exit,cannot confirm replay process group cleanup: [Errno 1] Operation not permittedyesprocessesyesprocessesSo the failure reproduces on a real Mac under load, not only on the hosted runner, and did not recur with the fix. 2 against 0 is a small sample on its own; it agrees with the mechanism the description gives.
The two new tests fail against the old code in all 200 old-code runs, as they should.
Also passed:
test_frame_capture_minimize.py(45/45),tools/check_conventions.py --base <merge base>,git diff --check.Not run: Windows, Linux, the C++ build.
AI-assisted (Claude Code).