-
Notifications
You must be signed in to change notification settings - Fork 120
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
fix rmw_get_graph_guard_condition #32
Conversation
previously it was just returning junk
lgtm, there are 6 instances of the 7 lines to get the participant from the impl that could be turned into a function. If there's expected to be more instances the helper function might be worth it. Otherwise we can leave it as is. |
Yeah, there's a lot of improvements that could be made, but with respect to deduplicating the code, in about half the cases you have to return https://github.com/ros2/rmw/blob/master/rmw/include/rmw/impl/cpp/macros.hpp And in https://github.com/ros2/rcl/blob/master/rcl/src/rcl/common.h#L26-L33 I'd leave it as-is for now and try to deduplicate code between this and the other rmw implementations in the future. |
CI looks good (existing warnings on Windows and flaky tests on Linux). |
try { | ||
node_impl = new FastRTPSNodeImpl(); | ||
} catch(std::bad_alloc & exc) { | ||
RMW_SET_ERROR_MSG("failed to allocate node impl struct"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this leak graph_guard_condition
?
Same for the other return statements below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The function was not setup to handle unrolling. None of the functions in this file are except one. So I didn't want to change that in these changes. In general I think this time implementation needs some clean up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…utor Take all available samples on service/client on_data_available. (ros2#616)
Previously it was just returning junk, which was left over from my
wait_for_service
work.This doesn't implement it, but at least it returns a valid guard condition. I wouldn't return anything at all, but
rcl_node_init
calls it, so I have to return something valid or else all fastrtps programs would fail.