Repository navigation
fix: cancel SOCKS TCP setup on forced close - #35
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The lifecycle change is narrowly scoped, correct, and covered by comprehensive regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Cancels pending SOCKS5 TCP setup when the downstream connection is forcibly closed while preserving established relay behavior.
Changes:
- Binds TCP dialing to the tracked connection lifecycle.
- Adds cancellation, half-close, payload, and shared-QUIC regression tests.
- Documents lifecycle and dialer limitations.
| File | Description |
|---|---|
internal/proxy/socks5.go |
Cancels pending CONNECT setup on full close. |
internal/proxy/lifecycle.go |
Generalizes connection-context documentation. |
internal/proxy/socks5_tcp_setup_cancel_test.go |
Tests forced-close cancellation and shared dialing. |
internal/proxy/socks5_tcp_setup_preserve_test.go |
Tests payload, half-close, and deadline preservation. |
docs/DEPLOYMENT.md |
Documents behavior and limitations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Cancel pending SOCKS5 TCP CONNECT setup when its tracked downstream connection is fully closed, instead of leaving that caller active until the existing dial budget expires.
Validation completed on
33e6add22ce91b28b4b710a95ce534426d513020make checkandmake race: exit 0, full repository.e3777fb53d9bed8e5c6d8ead4db34b3c137f9f0858a404f27f9edc5dcd1eac90.Exact-head GitHub verification completed, all on attempt 1:
Post-merge verification completed on
ae60c176fcac70301dcd593d05f5225dcd66efbb:dca06fd185bcda9e61c66694c504357e105e4e18). Main targeted race ×3 passed.TestProxyComposition/quic, waiting for a SOCKS reply at the unchanged 5s operation deadline; new proxy regressions passed in that same job. The full initial log is preserved.The initial macOS timeout remains unexplained and is not described as a fixed infrastructure cause or a first-attempt main pass.
Boundaries
Custom dialers ignoring context cannot be forcibly interrupted. This does not add immediate peer-disconnect detection during pending TCP setup, does not change protocol framing or dependencies, and does not modify v1.0.1 or create a release/tag. No remote host or large capture campaign was used. These lifecycle tests do not establish traffic equivalence or comparative performance.