Hi everyone,
I’d like to bring attention to an issue I’ve encountered in the ROS 2 multi-threaded executor that can lead to task starvation when using mutually-exclusive callback groups. This problem has been observed in some issues on GitHub, and I’ve put together a pull request to address it.
Issue Overview
In the current implementation, when you have a mutually-exclusive callback group (for example, two timers that should alternate execution), the executor may end up repeatedly executing one task while starving the other. In our opinion, this behavior is unintuitive. Ideally, all tasks should be executed at some point, in any system configuration.
References
We have written a paper on this issue, including a fix for ROS 2 Humble. You can find it here.
Call for Feedback
Since our current fix only addresses this issue in ROS 2 Humble, we are currently working on fixing this issue in Rolling, which has since received some code changes. I’ve implemented parts of our fix and will be committing further modifications starting next week. I’d really appreciate feedback and contributions on this if you are interested. I look forward to your input!
Best regards,
Harun Teper