feat: name the subscriber (node + topic) in the UDS send-drop warning… - #18
Open
benaliabderrahmane wants to merge 1 commit into
Open
feat: name the subscriber (node + topic) in the UDS send-drop warning…#18benaliabderrahmane wants to merge 1 commit into
benaliabderrahmane wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves slow-subscriber drop diagnostics for the Unix Domain Socket (UDS) transport by attaching a human-readable subscriber identity (fully-qualified node name + topic) to ENOBUFS/EAGAIN send-drop warnings, while keeping the publish hot path allocation-free by caching the formatted label on graph changes.
Changes:
- Add
make_peer_label()to formatnode '/ns/name' on topic '/topic'(with sensible null/root handling) and test coverage for it. - Extend the publisher subscriber cache from socket paths to
{socket_path, label}entries and plumb labels intosend_to()from publish and TRANSIENT_LOCAL replay paths. - Update the ENOBUFS/EAGAIN warning to clarify the dropped byte count and include the configured receive buffer size for reference.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rmw_unix_socket_cpp/test/test_transport.cpp | Adds unit tests validating peer label formatting edge cases. |
| rmw_unix_socket_cpp/src/types.hpp | Introduces CachedSubscriber and updates publisher cache to store {path,label} entries. |
| rmw_unix_socket_cpp/src/transport.hpp | Extends send_to() with optional peer_label and declares make_peer_label(). |
| rmw_unix_socket_cpp/src/transport.cpp | Implements make_peer_label() and improves ENOBUFS/EAGAIN drop warning content. |
| rmw_unix_socket_cpp/src/rmw_wait.cpp | Populates and uses cached subscriber labels for TRANSIENT_LOCAL replay sends. |
| rmw_unix_socket_cpp/src/rmw_publisher.cpp | Populates and uses cached subscriber labels for publish and replay sends. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+190
to
+194
| "UDS send to %s (socket '%s') dropped: subscriber recv queue full — " | ||
| "dropped a %zu-byte message (recv buf configured %d MB, errno=%s). " | ||
| "Slow subscriber or undersized SO_RCVBUF.", | ||
| dest_path.c_str(), total, std::strerror(err)); | ||
| peer_label ? peer_label : "peer", dest_path.c_str(), total, | ||
| RECV_BUF_SIZE / (1024 * 1024), std::strerror(err)); |
Comment on lines
+54
to
+56
| // "node '/ns/name' on topic '/topic'". Null/empty fields are omitted; a "/" | ||
| // (root) namespace collapses to a single leading slash (ROS fully-qualified | ||
| // name), so ("/", "name", ...) yields "/name" rather than "//name". |
benaliabderrahmane
force-pushed
the
fix/uds-drop-log-subscriber-name
branch
from
August 19, 2026 13:02
5b2d46d to
78d25aa
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rmw_unix_socket_cpp/src/transport.cpp:196
- The drop warning reports
total = sizeof(WireHeader) + payload_size, but the message text says “dropped a %zu-byte message”, which reads like the serialized ROS message size. Either logpayload_sizeinstead, or clarify that the count is the on-wire datagram size (incl. header) to avoid confusion when users compare against their message size.
"UDS send to %s (socket '%s') dropped: subscriber recv queue full — "
"dropped a %zu-byte message (recv buf configured %d MB, errno=%s). "
"Slow subscriber or undersized SO_RCVBUF.",
peer_label ? peer_label : "peer", dest_path.c_str(), total,
RECV_BUF_SIZE / (1024 * 1024), std::strerror(err));
… and clarify the byte count
The drop warning printed only the peer's socket path and worded the
message size as if it were the receive-buffer fill level
("recv buffer full (N bytes)"). Both made a slow-subscriber drop hard
to diagnose: the path only encodes a PID, and the byte count looked
like it contradicted the configured buffer size.
Now the ENOBUFS/EAGAIN branch names the offending subscriber by its
fully-qualified node name and topic, states plainly that the number is
the dropped message's size, and shows the configured recv-buffer size
for reference.
The peer label is built once per graph change (in refresh_subscribers,
off the hot path) and stored in the copy-on-write subscriber cache
alongside the socket path, so the publish hot path still copies just a
refcount and never formats a string. send_to takes an optional
peer_label; the three publisher fan-out paths supply it,
request/response callers pass none and are unaffected.
Rewritten against current devel: the wake-side TRANSIENT_LOCAL replay
this originally also touched in rmw_wait.cpp no longer exists (#60's
pull-based replay), and the three cache-refresh sites it edited are now
the single refresh_subscribers helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Names the offending subscriber (fully-qualified node name + topic) in the UDS send-drop warning and clarifies that the byte count is the dropped message's size, not the buffer fill level. Before/after:
How
make_peer_label(ns, name, topic)in transport.cpp (unit-tested, incl. root-namespace collapse and null tolerance).CachedSubscriber {socket_path, label}; labels are built once per graph change insiderefresh_subscribers, so the publish hot path still copies one refcount and never formats a string.send_togains an optionalpeer_label(default null). The three publisher fan-out paths supply it; request/response callers are unchanged.Rebased and retargeted onto
develRewritten against current devel (single commit): the wake-side TRANSIENT_LOCAL replay this originally also patched in
rmw_wait.cppno longer exists (#60 made replay pull-based, so the wait path no longer sends), and the three cache-refresh sites it edited are now devel's singlerefresh_subscribershelper — the feature got smaller by landing after those changes.Verified: 14/14 ctest in the jazzy container; the churn stress test triggers a real drop and prints the new labeled warning.