Reap foreground job-control process groups - #192
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe POSIX subprocess teardown now detects the terminal foreground process group, coordinates SIGHUP and SIGKILL handling for two groups, preserves direct-child fallback behavior, and adds regression coverage for concurrently reaped leaders. ChangesPOSIX subprocess teardown
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SubprocessStop as Subprocess stopping
participant Pty as PTY
participant CommandTermination as POSIX command termination
participant ProcessGroups as Primary and foreground groups
SubprocessStop->>Pty: Read foreground process-group ID
Pty-->>SubprocessStop: Return group ID
SubprocessStop->>CommandTermination: Start timeout-aware shutdown
CommandTermination->>ProcessGroups: Send SIGHUP and probe both groups
ProcessGroups-->>CommandTermination: Return group status
CommandTermination->>ProcessGroups: Send SIGKILL after shared deadline
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Verification
zig build test -Dtest-filter="subprocess stop"cmux issue: manaflow-ai/cmux#9573
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Reap foreground job-control process groups when stopping a subprocess so foreground jobs don’t linger after the terminal closes. Fixes SIGHUP-resistant foreground groups remaining alive (see cmux issue ghostty-org#9573).
EPERMfromkillpgon Darwin.Written for commit 47e9bd4. Summary will update on new commits.
Summary by CodeRabbit