-
-
Notifications
You must be signed in to change notification settings - Fork 925
[client] The status cmd will not be blocked by the ICE probe #4597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Refactor turn, stun probe and cache the results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors STUN/TURN probing to be non-blocking and cache results so the client status command can show a "Checking..." state instead of being blocked by ICE probing.
- Introduces StunTurnProbe with result caching and in-progress signaling.
- Integrates the new probe into Engine and updates status rendering to show "Checking..." when probes are underway.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| client/status/status.go | Adds handling to display "Checking..." when relay probe is in progress. |
| client/internal/relay/relay.go | Adds StunTurnProbe with caching, in-progress sentinel, and refactors probe logic into methods. |
| client/internal/engine.go | Instantiates and uses StunTurnProbe in health probes flow. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if relay.Error == probeRelay.ErrCheckInProgress.Error() { | ||
| available = "Checking..." | ||
| } else { |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This relies on string matching an error message to detect the in-progress state, which is brittle. Prefer a structured field (e.g., a status enum or a boolean InProgress) or a stable error code to signal 'checking' across layers.
client/internal/relay/relay.go
Outdated
| case <-probeDone: | ||
| // when the probe is return fast, return the results right away | ||
| return p.getCachedResults(cacheKey, stuns, turns) | ||
| case <-time.After(1300 * time.Millisecond): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can leak if any of the other cases are selected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
until 1300 milliseconds
|



The status cmd will not be blocked by the ICE probe
Refactor the TURN and STUN probe, and cache the results. The NetBird status command will indicate a "checking…" state.
Describe your changes
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__