Repository navigation
Allow disconnect to stop the G5 dashboard welcome read - #588
Conversation
urfeex
left a comment
There was a problem hiding this comment.
All in for an interruptible read here. Two things I would like to add, though:
- I think the timeval setup outside of the try-catch block is now unused and can therefore be removed.
- This isn't a thing changed by this PR, but I think it would be good to address this, anyway: On a TimeOutException when no stop is requested, there is a warning printed and the whole loop is retried. This will then fail, as we will attempt to connect to an already connected socket. We should probably disconnect in the catch block, as otherwise there is no way to retry establishing a connection from the outside after this, as
connectwill always fail then. We should also fail connect in that case immediately.
| PROPERTIES TIMEOUT 20 RUN_SERIAL TRUE) | ||
| set_tests_properties(DashboardClientWelcomeTest.welcome_timeout_allows_external_retry | ||
| PROPERTIES TIMEOUT 30 RUN_SERIAL TRUE) |
There was a problem hiding this comment.
RUN_SERIAL is probably overkill, as our tests currently require to be run in serial altogether. But it won't hurt to have it here, so feel free to ignore this comment.
|
@shin4141 Is there something you would like to add or can we mark this ready for review? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #588 +/- ##
==========================================
+ Coverage 83.24% 83.76% +0.51%
==========================================
Files 121 126 +5
Lines 7737 8167 +430
Branches 3561 3757 +196
==========================================
+ Hits 6441 6841 +400
- Misses 912 922 +10
- Partials 384 404 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
PR SummaryMedium Risk Overview Instead of a single long Robot-free regressions use a loopback Reviewed by Cursor Bugbot for commit 6b79937. Bugbot is set up for automated code reviews on this repo. Configure here. |
Co-authored-by: Felix Exner <feex@universal-robots.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 6b79937. Configure here.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |

Related issue: ROS 2 Driver #2012.
Coordinated dependency
This library change does not resolve #2012 by itself: with the unmodified Driver, shutdown still took 10.158 s because its in-flight dashboard client was not visible to
stop(). The companion Driver PR #2013 publishes that client before the blocking call. Conversely, the Driver change alone still took 10.235 s with the old URCL welcome receive. Both changes are required for the observed prompt exit. This remains draft until the cross-repository path is reviewed.Change
For G5's initial dashboard welcome line, poll receive in 100 ms slices while preserving bytes across slices and the former ten-second per-character allowance. A deliberate
disconnect()now ends this receive without entering the timeout retry path. Restore the configured receive timeout on success, ordinary failure, and interruption. Normal command-response behavior and the PolyScope X implementation are not changed.Adds a robot-free CTest regression: a loopback server accepts port 29999 but sends no welcome, then the client is disconnected while
connect(1)waits. The test requires the connection thread to finish within three seconds and return false.Validation
master35da05b1aa2067991c059610f8bb2a658384912cin an isolated ROS Rolling/Linux container.maind113bc33045142c8dbd98091cab14a1cfb9dd260, the 29999 silent-welcome SIGINT fixture exited 0 in 0.126 s on this fresh build (the earlier qualification run was 0.146 s). Normal dashboard connection, genuine startup-failure, Primary retry, and autoconnect-disabled controls passed. The new Driver launch test and #2006's two startup launch tests passed.Only loopback peers were used. No real robot, URSim, Windows/macOS, PolyScope X, or full upstream suite was tested. This PR deliberately does not use an auto-closing
Fixeskeyword because its merge alone is insufficient.