You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timers being executed more than once by the multithread executor #1374
https://github.com/ros2/rclcpp/commit/2531787550084307a5c8144a68c0195fcdd6442a or previous commits (i.e. current master)
I don't catch up with you the following sequence, could you enlighten me a bit?
Thread B sees that the timer is ready to be executed (get_next_executable).
Thread A executes the timer and removes it from the scheduled timer collection.
Thread B checks if the timer has been scheduled ... but thread A has already removed it from the collection. So thread B executes the timer again.
with above sequence how Thread A can be on running to access scheduled_timers_ in the middle of Thread B? Thread B is protected with wait_mutex_
Thread B sees that the timer is ready to be executed (get_next_executable).
Thread A executes the timer (but not removes it from the scheduled timer collection.)
Thread B checks if the timer has been scheduled, and see it is scheduled the continue.
Thread A removes it from the scheduled timer collection.
Activity
fujitatomoya commentedon Sep 29, 2020
@ivanpauno
I don't catch up with you the following sequence, could you enlighten me a bit?
with above sequence how
Thread Acan be on running to accessscheduled_timers_in the middle ofThread B?Thread Bis protected withwait_mutex_rclcpp/rclcpp/src/rclcpp/executors/multi_threaded_executor.cpp
Lines 78 to 98 in 0e7fed9
scheduled_timers_rclcpp/rclcpp/src/rclcpp/executors/multi_threaded_executor.cpp
Lines 106 to 109 in 0e7fed9
I think that it should be the following sequence,
ivanpauno commentedon Sep 29, 2020
Yeah, I was writing the temporal sequence in the code and I think you're right.
The sequence you comment can make the timer miss a trigger, but cannot produce double execution AFAIS.
I have to double check my reasoning here.
ivanpauno commentedon Oct 5, 2020
Wrong repository 😕, moving to
rclcpp.ivanpauno commentedon Jan 14, 2021
Closing as the description of the issue is not accurate, #1487 seems to be the real issue (?).