fix: bound and cancel discovery probes - #23
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 SummarySummary by CodeRabbit
WalkthroughChangesThe pull request adds context cancellation to discovery and tunnel dialing. It adds per-probe timeouts, bounded probing, transport cleanup, and stricter YAML validation. Tests cover cancellation, timeout, defaults, unknown keys, and multiple documents. Context-aware network operations
Strict YAML configuration loading
Merge Risk: 🟡 Moderate · up to Failed probe transport setup can appear as an empty discovery result, masking unavailable remote discovery. Port order can also vary between equivalent sweeps. Resolve these before merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/tunnel/tunnel.go (1)
197-197: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftMake
reconnectand SSH transport dialing honorctx.After the context check,
reconnectcan wait onreconnectMuandm.connectcan invoke context-freem.dial.dialRemoteusesssh.Dialand context-free ProxyJump operations; the 10-second SSH timeout does not bound lock waits or every handshake.DialContextcan therefore outlive its deadline. Make lock acquisition cancellable and propagatectxthrough every transport and ProxyJump operation, including cancellation cleanup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Team
Run ID: 11c13fad-38fb-46e0-af63-b7262853ecb8
📒 Files selected for processing (7)
cmd/mole/main.gointernal/config/config.gointernal/config/config_test.gointernal/discover/discover.gointernal/discover/discover_test.gointernal/tunnel/reconnect_test.gointernal/tunnel/tunnel.go
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Fixes Applied SuccessfullyFixed 2 CodeRabbit findings in 2 files. Files modified:
Commit: 7cbd792 The latest autofix changes are on the codex/reject-unknown-config branch. |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Team
Run ID: 8082656f-64d7-4d12-8c90-955dd5aa9202
📒 Files selected for processing (2)
internal/tunnel/reconnect_test.gointernal/tunnel/tunnel.go
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Fixes Applied SuccessfullyAddressed the CodeRabbit performance finding about one SSH handshake per discovery probe. Changes:
Files modified:
Commit: 366172c |
Fixes Applied SuccessfullyAddressed the CodeRabbit finding Restore config.Timeout for SSH TCP connects. Changes:
Files modified:
Commit: 8e8aa01 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Team
Run ID: 8fd62fe3-9ca5-41d3-96a6-ba1c7792a9bb
📒 Files selected for processing (5)
cmd/mole/main.gointernal/discover/discover.gointernal/discover/discover_test.gointernal/tunnel/reconnect_test.gointernal/tunnel/tunnel.go
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review.
Fixes Applied SuccessfullyAddressed the CodeRabbit Major finding Return sweep transport setup errors to the caller. Changes:
Files modified:
Commit: ee61c07 |
CodeRabbit fix appliedAddressed the remaining deterministic-order finding:
Validation: Commit: |
Summary\n\n- bound every candidate probe to a five-second deadline\n- propagate the auto-discovery context through Probe and the SSH tunnel\n- stop all probes promptly when the discovery cycle is cancelled\n- add cancellation, timeout, and SSH DialContext regression tests\n\nCloses #13\n\n## Validation\n\n- 170 Go tests passed\n- race tests passed\n- go vet passed\n- gofmt and diff checks passed