Skip to content
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

RSDK-9300 - make mdns query more generic over local-ness of candidate #140

Merged

Conversation

stuqdog
Copy link
Member

@stuqdog stuqdog commented Jan 24, 2025

Fixes issue where rust-utils was unable to find an mDNS candidate for micro-rdk robots.

Tested locally: before change, was unable to connect to a native micro-rdk process with signaling disabled. After change, I was able to connect to the same micro-rdk process whether signaling was enabled or not. Also tested to ensure no regression in connectivity to a locally running viam-server process, both with wifi on and with wifi off.

cc @acmorrow

@stuqdog stuqdog requested a review from a team as a code owner January 24, 2025 16:40
@stuqdog stuqdog requested review from njooma and lia-viam January 24, 2025 16:40
@@ -400,7 +403,7 @@ impl<T: AuthMethod> DialBuilder<T> {

let ifaces: HashMap<&str, Vec<&IpAddr>> =
ifaces.iter().fold(HashMap::new(), |mut map, (k, v)| {
map.entry(k).or_insert(vec![]).push(v);
map.entry(k).or_default().push(v);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flyby

let discovery = discover::interface_with_loopback(
addr_to_send,
VIAM_MDNS_SERVICE_NAME,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See added comment re: the localness of machine URIs to understand why this is important. Basically, we were trying to discover candidates with a fully qualified name. but, the fully qualified name we were passing was non-local and, for reasons not entirely clear to me, the only candidates we could find from a micro-rdk process were the ones with a local name. By making our search more generic we can find everything that looks Viam-y, and then narrow it down based on the actual name of the machine.

@njooma njooma merged commit 5564862 into viamrobotics:main Jan 27, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants