rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

DRAFT: Fix: Double spin required since 28.2.0

Open jmachowinski opened this issue 1 year ago • 5 comments

This is a first attempt to fix #2589.

Rebuild the collection explicitly before the wait, if the notify_waitable_ has been triggered.

jmachowinski avatar Aug 02 '24 13:08 jmachowinski

@alsora can you run the CI on this ?

jmachowinski avatar Aug 02 '24 16:08 jmachowinski

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

alsora avatar Aug 02 '24 16:08 alsora

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/next-client-library-wg-meeting-friday-16th-august-2024/39130/1

ros-discourse avatar Aug 15 '24 03:08 ros-discourse

@jmachowinski A friendly ping to fix CI failures to move forward with this PR.

MichaelOrlov avatar Aug 22 '24 18:08 MichaelOrlov

@MichaelOrlov we spoke about this bug in the last client workgroup meeting. We don't think this is the correct fix, but a step into the right direction.Unfortunately I currently don't have much time I can divert to rclcpp.

jmachowinski avatar Aug 23 '24 08:08 jmachowinski

PR https://github.com/ros2/rclcpp/pull/2591 merged. That PR introduces unit-tests and fixes this problem for the events executor.

I looked a bit more into the waitset executor issue, and IMO even if this PR is likely not the best way to address the problem, it definitely improves the situation in a relatively simple way, fixing the bug reported by the nav stack and passing the unit tests that I added in the other PR.

My recommendation is to:

  • move the new logic to a dedicated function
  • run this new function only for spin some, spin once and spin all, rather than in each wait for work (e.g. by adding a bool flag to wait for work). spin does not need it, and it would only cause unnecessary overhead.
  • enable the single threaded executor in the new unit tests.

If people agree, I can take care of pushing these changes (or @jmachowinski can do it if he has time).

alsora avatar Sep 11 '24 09:09 alsora

closing in favor of https://github.com/ros2/rclcpp/pull/2724

jmachowinski avatar Jan 10 '25 14:01 jmachowinski