uxrce_dds_client: avoid stalls under high UDP load #26161
+68
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Problem
Relates to #26160
High-rate ROS 2 -> PX4 traffic over Ethernet/UDP (uXRCE-DDS) can cause
uxrce_dds_clientto stall:/fmu/out/*topics stop publishinguxrce_dds_client statusstops updating (counters frozen)This PR is primarily intended to surface the issue upstream and contribute one mitigation/fix approach I tested on PX4 v1.16.0.
Solution
deinit()(let the transport close its own fd)FIONBIO) to prevent blockingsend()under heavy inbound loaduxr_run_session_timeout()multiple times per loop while data is pendingUXR_INVALID_REQUEST_IDto handle output buffer full/fmu/out/*forwarding rate ceiling.Rationale: the system already supports high-rate
/fmu/out/*publishing, but the previous default poll/forwarding interval (10 ms) effectively capped the default forwarding rate; reducing it increases the maximum forwarding rate available out of the box and helps keep/fmu/out/*rates stable under highinbound
/fmu/in/*load.Changelog Entry
For release notes:
Bugfix: uxrce_dds_client: avoid stalls under high UDP load and improve throughput under bursts
Alternatives
Test coverage
make px4_fmu-v6x(note: current main hitsFLASH overflowin my environment; this change adds ~136 bytes in.text).px4_fmu-v6x/fmu/in/actuator_motors/fmu/out/*rates stableContext