-
Notifications
You must be signed in to change notification settings - Fork 136
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
Correct rcl entity lifecycles and fix spurious test failures #386
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b7dd6a2
Reworking the lifecycle management of rcl bindings
mxgrey d3df842
Manage all rcl bindings with Handle structs
mxgrey 10b2bcb
Keep context alive for guard conditions
mxgrey 81c065e
Introduce InitOptions to allow manually setting domain ID
mxgrey f30a284
Ensure that mutex guards are not being dropped prematurely
mxgrey 2adcf3e
Apply lifecycle lock to all middleware entities
mxgrey 4dc88b1
Run rustfmt
mxgrey 1b6eeb4
Run clippy
mxgrey f2ca13e
Ensure that test_graph_empty works even if the system has ROS_DOMAIN_…
mxgrey 44d6166
Run rustfmt
mxgrey 8b6e825
Use usize instead of u8 for domain id
mxgrey 90bdd05
Merge branch 'rcl_lifecycles' of ssh://github.com/mxgrey/ros2_rust in…
mxgrey 6d90431
Satisfy clippy
mxgrey 4caa208
Remove the need for lazy_static
mxgrey 5abbb34
Update documentation and safety info on rcl entity lifecycles
mxgrey cf0d434
Rename to avoid confusion with Handle pattern
mxgrey 21d3b35
Improve the documentation for the domain ID situation of test_graph_e…
mxgrey 0efa831
Update documentation on ENTITY_LIFECYCLE_MUTEX
mxgrey 8a16367
Get rid of doc links to private structs
mxgrey 58b2c66
Fix link formatting
mxgrey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
nit: This would actually be in
rcl
, not anrmw
implementation right?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.
No the comment is correct as-is. To be more concrete about it: Most of the segfaults we were seeing are coming from
FastDDS
viarmw_fastrtps_cpp
, which is an RMW implementation.The segfaults happen because that particular RMW implementation makes unsafe use of global variables. That problem would exist whether or not RCL is thread-safe.
Note that "RMW implementation" =/= "the implementation of the
rmw
library", although the human language aspect of all this is admittedly very confusing.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.
But in the unsafe block below, we are calling
rcl_init()
, not an RMW implementation function. I'm not as familiar with the internals ofrcl
as I should be, but perhapsrcl_init()
is then calling an RMW implementation function?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.
Correct, client libraries like
rclrs
do not ever call anyrmw
functions directly. Insteadrcl
is the abstraction layer that all client libraries are supposed to interface with. Many (but not all) rcl functions will then call rmw functions as needed, and those rmw functions will hook the calls into whatever RMW implementation has been loaded.As a rule of thumb, any rcl function that involves sending information out over a middleware (including to form connections and perform discovery) will call into the RMW implementation. But this is something that I would recommend rcl to officially document.