-
Notifications
You must be signed in to change notification settings - Fork 24
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
dialdbg initial implementation #57
Conversation
Will take a look today! |
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.
Done with a first pass. nice!
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.
Mostly optional language comments. Logic looks reasonable
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.
Done with first pass. Tricky to use log file to pass stats around (tracing could be better here) but for a POC i think its fine. I would definitely add a test to make sure that parsing works when the rust-lib gets updated.
Your parsing fails on the first error encountered, so where it makes sense I would continue parsing even in case of errors.
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.
First pass, looks pretty good!
(removed @jckras as a reviewer to avoid a "too many cooks" situation, Julie feel free to look of course if you're interested!) |
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.
LGTM from my side but I am yet a lowly rust newbie.
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.
LGTM
Don't have time for in-depth review, but overall LGTM! |
// NOTE(benjirewis): Use a duration of 1500ms for getting the mDNS URI. I've anecdotally | ||
// seen times as great as 922ms to fetch a non-loopback mDNS URI. With an | ||
// interface_with_loopback query interval of 250ms, 1500ms here should give us time for ~6 | ||
// queries. |
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.
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.
LGTM!
pub(crate) const DIAL_ERROR_PREFIX: &'static str = "unexpected dial connect error"; | ||
|
||
#[derive(Debug, Default)] | ||
pub(crate) struct GRPCResult { |
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.
Probably over-engineering right now, but it would be neat if we could dedup some of the shared code across GRPCResult
and WebRTCResult
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.
That's a good point; I probably won't in this PR, but I can imagine deduping more in the future as the code around these structs increases (potentially as part of RSDK-3444).
RSDK-3442
RSDK-3443
cc @edaniels , @cheukt , @zaporter-work , @mattjperez
Implements a basic CLI tool,
dialdbg
, to better understand the behavior ofrust-utils
' dial functionality (both through gRPC and WebRTC).dialdbg --help
output:dialdbg --uri URI --credential ROBOTSECRET
output whereURI
is a robot on the same subnet (connectable to through mDNS) andROBOTSECRET
is its robot location secret.dialdbg --uri BAD_URI --secret ROBOTSECRET
output wherebad_rover.json
is an incorrectviam.cloud
URI.Similar errors are output for invalid secret and invalid non-viam URI respectively: