Repository navigation
Fix race conditions and stale SSH client process in SshSocksConnector - #54
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The stale-process regression test must distinguish connector-triggered termination from natural process exit.
1 open issue
What changed in this PR
Fixes shared SSH process lifecycle races in SshSocksConnector.
Changes:
- Prevents cancelled attempts from opening SOCKS connections.
- Protects replacement process references and clears exited processes.
- Adds regression tests for cancellation and process-exit timing.
| File | Description |
|---|---|
| tests/IntegrationSshSocksConnectorTest.php | Adds four lifecycle regression tests. |
| src/SshSocksConnector.php | Corrects cancellation, idle cleanup, and process-exit handling. |
Review effort: Balanced
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.

This changeset fixes several race conditions and a stale SSH client process in
SshSocksConnector. These date back to the shared SSH client process from #8 and only show when a connection attempt is cancelled or the SSH client exits at the wrong moment:Call to a member function then() on null.Each fix comes in its own commit with a test reproducing the original problem.
Builds on top of #52, #50 and #8
Refs clue/reactphp-redis#105 and friends-of-reactphp/mysql#110