Repository navigation
fix: reclaim posix harness trees orphaned by a crashed meshloop - #39
Merged
Merged
Conversation
On POSIX a harness process group outlives an aborted Meshloop. Recovery then marked the attempt crashed and retried while the old tree kept running against the worktree. Per the accepted option 1 (recovery reconciliation, ADR 0025 amendment): RunLoop cancels an untracked Running attempt before recording the crash, and CliHarness::cancel kills an untracked attempt's recorded pid via process::kill_orphaned_tree, only when the pid is alive, runs the harness executable, and (POSIX) leads its own process group. Implements #30 Closes #30 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implements #30
Closes #30
Problem
On POSIX, a harness process group outlives an aborted Meshloop, because a group has no equivalent of the Job Object's kill-on-close. On restart, recovery saw the attempt as untracked, recorded
HarnessCrashedOrTimeoutand retried, while the old tree kept running against the worktree.Change (option 1: recovery reconciliation, safe Rust)
RunLoop::reattach_running: aRunningattempt the harness no longer tracks is cancelled before the crash is recorded.CliHarness::cancel: for an untracked attempt with a recorded pid, calls the newprocess::kill_orphaned_tree.kill_orphaned_treeguards against pid reuse. It kills only when the pid is alive and runs the harness executable (image name on Windows;common POSIX, which Linux truncates to 15 bytes), and on POSIX only when the pid still leads its own process group.grandchild_dies_on_parent_abortnow says it is Windows-only.Known limits
resumeorstatusof that graph, not immediately.cancelcall covered by the adapter tests and the end-to-end suites.Merge note
#38 also appends an amendment to ADR 0025. Whichever merges second needs a trivial rebase; I will handle it.
Validation
cancel_kills_an_orphaned_tree_left_by_a_previous_processfails without the untracked-pid branch ("orphaned leader 36968 survived cancel") and passes with it.cancel_leaves_an_unrelated_process_with_a_recorded_pid_alonecovers the pid-reuse guard.xtask check(17 suites) andsmokepass.xtask check(17 suites) andsmokepass, with 0 leftover fixture processes.🤖 Generated with Claude Code