Repository navigation
Fix PTY resource leaks, child lifecycle and integration coverage - #1
Merged
Merged
Conversation
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.
Closing a session previously left its original PTY master open, and failed executable resolution leaked both master and slave descriptors. This prevented the expected hangup and accumulated resources in long-running CLI processes.
This change closes both owned master descriptors, makes cleanup idempotent, and closes inherited php-pty sessions in newly forked children. It validates executable paths, working directories and terminal dimensions before allocation, preserves executable symlinks, and prevents failed child setup/exec from running inherited PHP shutdown callbacks.
Child status handling now retries interrupted waits, preserves unknown statuses when another manager has reaped the child, and uses monotonic deadlines. Invalid timeouts are rejected. The README documents short writes, wait results and explicit process cleanup.
Validation: