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

Support loaned message passed by intraprocess #1769

Open
mauropasse opened this issue Sep 9, 2021 · 6 comments
Open

Support loaned message passed by intraprocess #1769

mauropasse opened this issue Sep 9, 2021 · 6 comments
Labels

Comments

@mauropasse
Copy link
Collaborator

Currently RCLCPP intra-process communication can't handle Loan Messages:

if (intra_process_is_enabled_) {
// TODO(Karsten1987): support loaned message passed by intraprocess
throw std::runtime_error("storing loaned messages in intra process is not supported yet");
}

After some CPU profiling done around Loaned Messages shown in #1642 (comment) I can tell that is not trivial to improve significantly the performances (CPU, latency). For small message passing, RCLCPP intra-process still performs at least twice as better. This leads me to the question of how much we could improve the use of Loaned Messages if they were supported by the intra-process manager, which will bring probably some benefits.

@Karsten1987 is there any updates on a plan to support Loaned Messages with intra-process communication?
@alsora @wjwwood

@wjwwood
Copy link
Member

wjwwood commented Nov 29, 2021

There is no update.

@esteve
Copy link
Member

esteve commented Nov 28, 2022

@wjwwood is this a limitation by design or just that it hasn't been implemented yet? If the latter, I can look into it, any guidance? Thanks.

@esteve esteve self-assigned this Dec 1, 2022
@esteve
Copy link
Member

esteve commented Dec 1, 2022

I'm working on this one.

Edit: unassigned myself, no longer working on this ticket

@gilduz
Copy link

gilduz commented Dec 6, 2022

I've just received the message: ""storing loaned messages in intra process is not supported yet"
For my application, it's mandatory to maintain some nodes in the same process, while other in separate processes. Support to intraprocess loaning would be great.

@esteve esteve removed their assignment Dec 6, 2022
@SebastianMauchly
Copy link

DDS vendors stepped up to design systems that make it possible to share huge messages between nodes in a true zero-copy way: first CycloneDDS via Iceoryx and then FastDDS. Then, ROS2 maintainers stepped up to create the loaning API so that this functionality could be used by ROS developers with minimum change to their publisher / subscriber callsites, and without breaking the encapsulation of which DDS vendor they were using. And in the background, we had ROS maintainers that developed the notion of Components so that the choice of whether your nodes run in the same process or separate ones is a runtime decision. Put together, this makes it so that ROS users can finally (finally!) not care about their message sizes and assume they will be moved in the most efficient way possible. Many of us in industry have been waiting with bated breath for all of those things to come together, because the sum is far greater than its parts.

... except, you fumbled at the goal line, and the loaning API doesn't support intraprocess. Intraprocess! The easiest of all cases, where a simple pointer can just be shared to the other node directly! I'm feeling bitten here, because I've moved mountains within my company to push us towards leveraging ROS2. The promise of totally fungible process layout and worry-free low-cost transport was one of the primary carrots I held up to motivate that transition. This humdinger of a missing feature has made a liar out of me, and I've seen nobody outside of this quiet github issue mention it.

Is there something I'm missing? All of the hard work done to make the process layout and transport mechanism a runtime policy decision is ruined without this feature, no? If this has been the case since 2021, how is it that OSRF didn't identify it and prioritize it for Iron? Is nobody actually going to use the loaning API? @Karsten1987 ? Bueller?

@CursedRock17
Copy link
Contributor

It seems that issue #2203 explains why loaned messages aren't efficient when used in an intraprocess. If there are DDS vendors that already support the sharing of large messages in zero-copy, why add the extra overhead of the LoanedMessage API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants