You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ignore-local-endpoints functionality to avoid double delivery #2202
ROS 2 currently has a problem with double-delivery of messages when combining intra-process and inter-process communication.
Consider for example a scenario where you have two processes:
a process contains publisher A and subscriber X
a process contains subscriber Y
When publisher A publishes a message, we would expect the message to be delivered to subscriber X via intra-process comm and to subscriber Y via inter-process comm.
However, what actually happens is a double delivery: the inter-process publication will indeed reach also subscriber X, which will then discard the message, but still wasting a non-negligible amount of resources.
In order to get around this problem, it's necessary to tell publisher A that it doesn't need to send inter-process messages to subscriber X which is in the same process and it's going to be serviced by intra-process comm.
ROS already has the concept of "ignore local endpoints", however this is applied to the whole process.
This can be problematic if in a process there are both entities with intra-process comm enabled and disabled.
We are working with eProsima to allow a more fine-grained control of the "ignore local endpoints" functionality, such that each ROS 2 entity can indicate that to the RMW.
This will allow to solve the problem of the double delivery.
In order to implement that, it looks like it's necessary to make some changes to the rclcpp logic that decides whether to publish inter or intra process.
changed the title [-]Add ignore-local-endpoints functionality[/-][+]Add ignore-local-endpoints functionality to avoid double delivery[/+]on Jun 2, 2023
So if we just rely on RMW LoanedMessage for intra-process communication w/o rclcpp one, this should be no problem? since that can be managed by RMW implementation? (i understand the performance is not as same with rclcpp intra-process communication)
@ahcorde this is mostly a short-term fix for the problem
Ideally we should be using RMW loaned messages as @fujitatomoya mentioned, but last time i checked we still had limitations in terms of messages supported for zero copy and performance
However, if publisher A is "ignoring local endpoints", this means that get_subscription_count() will only return the non-local ones.
i do not understand this particular sentence... there is no such API for publisher endpoint to ignore local endpoints? ignore_local_publications can be be set in SubscriptionOption to ignore the message on the delivery if the publisher GUID is in the same process space.
IMO,
the double delivery problem itself is a real current problem in ROS 2, this does exist.
a local subscriber with intra-process enabled will still receive the inter-process copy (and discard it), wasting resources.
but the rclcpp logic change proposed in the issue is not fixing a bug in the current code.
Activity
[-]Discussion: add ignore-local-endpoints functionality[/-][+]Add ignore-local-endpoints functionality[/+][-]Add ignore-local-endpoints functionality[/-][+]Add ignore-local-endpoints functionality to avoid double delivery[/+]fujitatomoya commentedon Jun 3, 2023
@alsora just checking my understanding.
So if we just rely on RMW
LoanedMessagefor intra-process communication w/o rclcpp one, this should be no problem? since that can be managed by RMW implementation? (i understand the performance is not as same withrclcpp intra-process communication)thanks,
MiguelCompany commentedon Oct 20, 2023
@alsora @fujitatomoya
I prepared a set of PRs for the following:
rmw_publisher_count_non_local_matched_subscriptionsrmw#358rmw_publisher_count_non_local_matched_subscriptionsrmw_implementation#221rmw_publisher_count_non_local_matched_subscriptionsrmw_fastrtps#727rcl_publisher_get_non_local_subscription_countrcl#1111get_non_local_subscription_countto PublisherBase #2338ahcorde commentedon Oct 1, 2025
@alsora @MiguelCompany @fujitatomoya are these PRs still relevant ?
fujitatomoya commentedon Oct 7, 2025
@ahcorde i will circle back to this issue later, thanks for the ping.
alsora commentedon Oct 11, 2025
@ahcorde this is mostly a short-term fix for the problem
Ideally we should be using RMW loaned messages as @fujitatomoya mentioned, but last time i checked we still had limitations in terms of messages supported for zero copy and performance
fujitatomoya commentedon Feb 13, 2026
i do not understand this particular sentence... there is no such API for publisher endpoint to ignore local endpoints?
ignore_local_publicationscan be be set in SubscriptionOption to ignore the message on the delivery if the publisher GUID is in the same process space.@MiguelCompany @alsora can you enlighten me on this part?
IMO,
the double delivery problem itself is a real current problem in ROS 2, this does exist.
a local subscriber with intra-process enabled will still receive the inter-process copy (and discard it), wasting resources.
but the rclcpp logic change proposed in the issue is not fixing a bug in the current code.