-
Notifications
You must be signed in to change notification settings - Fork 304
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
Add resources_lock_ lock_guards to avoid race condition when loading robot_description through topic #1451
Add resources_lock_ lock_guards to avoid race condition when loading robot_description through topic #1451
Conversation
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.
LGTM
@saikishor I just tested this PR and it seems like the treading/lock issue is gone. It can not load the |
I believe this is related to the ABI/API breaking changes. If you are using this branch directly in rolling, then you would also need to use the master branch of |
There's a conflict to resolve sir! |
63077fd
to
65ffd19
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1451 +/- ##
=======================================
Coverage 87.79% 87.79%
=======================================
Files 102 102
Lines 8764 8766 +2
Branches 787 787
=======================================
+ Hits 7694 7696 +2
Misses 792 792
Partials 278 278
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@bmagyar Fixed! |
You are here protecting Besides that, something for the future. We should probably have a similar approach with two lists for the controller and also for hardware to enable more dynamics everywhere. |
@destogl Yes, the thing is the resource manager was trying to execute the components while changing their state, so the I agree with you regarding the 2 lists. We can try to implement it in the near future. Thank you! |
…robot_description through topic (backport #1451) (#1600) * Add resources_lock_ lock_guards to avoid race condition when loading robot_description through topic (#1451) (cherry picked from commit 25f2c97) # Conflicts: # hardware_interface/src/resource_manager.cpp * Fix merge conflicts * Fix format --------- Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com> Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com> Co-authored-by: Dr. Denis <denis@stoglrobotics.de>
…robot_description through topic (backport #1451) (#1599) * Add resources_lock_ lock_guards to avoid race condition when loading robot_description through topic (#1451) (cherry picked from commit 25f2c97) # Conflicts: # hardware_interface/src/resource_manager.cpp * Try fixing conflict. --------- Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com> Co-authored-by: Dr. Denis <denis@stoglrobotics.de> Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
As reported in #1442, loading the robot_description through the topic will cause a segmentation fault or some undefined behaviors as the read and write methods real-time methods are continuously executed, and when the robot description is received and the resource_manager is to be initialized, there is no lock_guard of recursive mutex
resources_lock_
, which should avoid the RM to execute the components when they are changing state or being loaded and initializedFixes #1442