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

Fix thread safety in LifecycleNode::get_current_state() for Humble #2183

Merged
merged 8 commits into from
Jun 27, 2023

Conversation

schornakj
Copy link

Implements #2172.

@schornakj
Copy link
Author

@clalancette @fujitatomoya what does the review process and timeline look like for getting this in? I noticed that this PR was added to the Humble Patch Release 4 project.

@fujitatomoya
Copy link
Collaborator

@schornakj generally we are now working on the Iron Irwini Release Test for now. but i will try to find some time to do review. let me have a week or two to get back to you. if anyone else are willing to do community review, that would be really appreciated.

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor comments, overall lgtm.

rclcpp_lifecycle/src/mutex_map.hpp Outdated Show resolved Hide resolved
rclcpp_lifecycle/src/state.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@fujitatomoya
Copy link
Collaborator

@clalancette @ros2/team can I have 2nd review on this before CI?

@schornakj
Copy link
Author

@fujitatomoya just checking in, were you able to find another person from the ROS 2 team to give this a second review?

@fujitatomoya
Copy link
Collaborator

No not yet, but i do need a second review on this.

@schornakj
Copy link
Author

schornakj commented Jun 6, 2023

@clalancette do you have some time to review this PR? It would be really great to be able to fix this thread safety issue at the root level. While I've been able to patch or work around this problem in some packages that use rclcpp_lifecycle (for example, by reverting a backported feature in ros-controls/ros2_control#1015), I keep running into new and exciting ways in which this bug causes my robots to crash.

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short, this is a fantastic backport. Thanks for taking the time to do this.

I've left three really small items to fix. Once those are fixed, I'll go ahead and run CI on this.

rclcpp_lifecycle/src/mutex_map.cpp Show resolved Hide resolved
rclcpp_lifecycle/src/mutex_map.cpp Show resolved Hide resolved
rclcpp_lifecycle/src/mutex_map.cpp Show resolved Hide resolved
@schornakj schornakj requested a review from clalancette June 26, 2023 16:39
@schornakj
Copy link
Author

@clalancette thank you very much for the review! I just pushed up a commit adding the includes you pointed out.

@clalancette
Copy link
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
Signed-off-by: Joe Schornak <joe.schornak@gmail.com>
@schornakj
Copy link
Author

CI failed with an error building rosbag2_transport, which I didn't modify as part of my changes:

--- stderr: rosbag2_transport
17:32:17 �[K/home/jenkins-agent/workspace/ci_linux/ws/src/ros2/rosbag2/rosbag2_transport/src/rosbag2_transport/recorder.c�[K In member functio�[Kvoid rosbag2_transport::Recorder::topics_discover�[K’:
17:32:17 �[K/home/jenkins-agent/workspace/ci_linux/ws/src/ros2/rosbag2/rosbag2_transport/src/rosbag2_transport/recorder.cpp:276:��[Kerro��[Kusing element_type = class rclcpp::Cl�[K’ {ak�[Kclass rclcpp::Cl�[K’} has no member name�[Kwait_until_star�[K’
17:32:17   276 |       if (this->get_clock()->�[Kwait_until_star�[K(record_options_.topic_polling_interval)) {
17:32:17       |                              �[K^~~~~~~~~~~~~~~�[K
17:32:17 �[K/home/jenkins-agent/workspace/ci_linux/ws/src/ros2/rosbag2/rosbag2_transport/src/rosbag2_transport/recorder.cpp:280:��[Kerro��[Kusing element_type = class rclcpp::Cl�[K’ {ak�[Kclass rclcpp::Cl�[K’} has no member name�[Kstar�[K’
17:32:17   280 |     if (this->get_clock()->�[Kstar�[K()) {
17:32:17       |                            �[K^~~~�[K
17:32:17 gmake[2]: *** [CMakeFiles/rosbag2_transport.dir/build.make:132: CMakeFiles/rosbag2_transport.dir/src/rosbag2_transport/recorder.cpp.o] Error 1
17:32:17 gmake[1]: *** [CMakeFiles/Makefile2:300: CMakeFiles/rosbag2_transport.dir/all] Error 2
17:32:17 gmake: *** [Makefile:146: all] Error 2
17:32:17 ---
17:32:17 Failed   <<< rosbag2_transport [46.7s, exited with code 2]

Should I rebase my PR branch onto the latest state of ros2:humble? I suspect that my PR branch might just be out of date.

@clalancette clalancette force-pushed the pr-backport-lifecycle-state-fix branch from 66dc5f9 to b5d61a4 Compare June 26, 2023 18:43
@clalancette
Copy link
Contributor

Ah right. This is failing to pass CI because it needs a rebase. I've done that and pushed it now, here is CI again:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor

All right, this looks good. Going ahead and merging. We just missed the window for a humble sync, so this will go out with the next patch release (probably 4-6 weeks).

@clalancette clalancette merged commit 25263e8 into ros2:humble Jun 27, 2023
@schornakj
Copy link
Author

Awesome!! Thank you for your guidance and help with this fix!

@clalancette
Copy link
Contributor

Thanks for your patience here and for doing the hard work of the backport.

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

Successfully merging this pull request may close these issues.

3 participants