fix(native): honor LCM_DEFAULT_URL in the rust LCM transport - #3740
fix(native): honor LCM_DEFAULT_URL in the rust LCM transport#3740jeff-hykin wants to merge 2 commits into
Conversation
liblcm reads LCM_DEFAULT_URL, so every python module lands on the bus it names, but the rust transport hardcoded 239.255.76.67:7667. The two halves of a pipeline then sit on different buses and nothing is delivered, with no error on either side. This is also why no python-to-native LCM integration test can pass: dimos' conftest pins each pytest session to its own udpm port for isolation, which the native side never joined.
Greptile SummaryThis change lets the native Rust LCM transport read Confidence Score: 4/5The URL fallback path needs correction or clearer semantics before merging because malformed endpoint values can still change the effective multicast TTL. The malformed-group and malformed-port paths were both executed with a valid TTL and consistently produced the default endpoint with an overridden TTL. Files Needing Attention: native/rust/dimos-module/src/lcm.rs, particularly the invalid group/port handling and subsequent TTL query parsing.
What T-Rex did
|
| _ => tracing::warn!( | ||
| url, | ||
| "LCM_DEFAULT_URL has no parsable group:port; using the defaults" | ||
| ), | ||
| } | ||
| } | ||
| for (key, value) in query.split('&').filter_map(|pair| pair.split_once('=')) { | ||
| if key == "ttl" { | ||
| if let Ok(ttl) = value.parse() { | ||
| options.ttl = ttl; | ||
| } | ||
| } |
There was a problem hiding this comment.
Invalid endpoints still override TTL
When group or port parsing fails, this branch warns that defaults are being used but continues into the query loop. URLs such as udpm://not-an-ip:7667?ttl=42 therefore retain the default group and port while changing the TTL to 42. Return immediately after the invalid-endpoint warning, or change the warning and document the intentional partial-fallback behavior, so malformed URLs cannot silently produce a hybrid configuration.
Artifacts
Temporary focused Rust test source for invalid endpoint with valid TTL
- This is the exact temporary test source copied into the private lcm test module and executed, covering invalid group and invalid port inputs with ttl=42.
Focused full-fallback expectation test failed
- The executed Rust test expected defaults after invalid endpoints and failed with actual TTL 42 versus default TTL 1, proving the claimed mismatch.
Focused partial-fallback observation test passed
- The executed Rust test printed both invalid URL results with default group and port but TTL 42, confirming partial fallback behavior.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Hand-splitting on "://", "?", ":" and "&" reimplements a parser that is already a dependency and gets the edge cases wrong.
rust didn't respect
LCM_DEFAULT_URLhttps://lcm-proj.github.io/lcm/content/multicast-setup.html#choosing-a-ttl