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

Race condition in MultiThreadedExecutor with intra_process communication resulting in dequeuing ring buffer before enqueuing #1007

Closed
brawner opened this issue Mar 1, 2020 · 0 comments · Fixed by #1213
Assignees

Comments

@brawner
Copy link
Contributor

brawner commented Mar 1, 2020

There is a race condition in the MultiThreadedExecutor that happens during the test_multithreahed.multi_consumer_intra_process test in test_rclcpp. The intra_process_buffer's ring_buffer_implementation has dequeue() called without any data. It may be that some process is calling dequeue() right after another has checked has_data().

This bug results in a flakey test with test_rclcpp, but it's fairly reliable to reproduce with sufficient repeat-until-fail iterations.

https://ci.ros2.org/view/nightly/job/nightly_linux_repeated/1780/testReport/(root)/projectroot/gtest_multithreaded__rmw_fastrtps_cpp/
https://ci.ros2.org/job/ci_windows/9412/testReport/

DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* Add `stop()` method for `rosbag2::Player` class

Stop will unpause if in pause mode, will stop playback and exit from
`play()` method.

Signed-off-by: Michael Orlov <[email protected]>
Co-authored-by: Misha Shalem <[email protected]>

* Add service call for `Stop` operation

Signed-off-by: Michael Orlov <[email protected]>

* Revisit logic in Player::stop() to avoid race condition in queue cleanup

Signed-off-by: Michael Orlov <[email protected]>

Co-authored-by: Misha Shalem <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants