fix: Prevent short time endless loop in expire_timer#1303
fix: Prevent short time endless loop in expire_timer#1303jmachowinski merged 2 commits intoros2:rollingfrom
Conversation
There were multiple bugs in this area: - The expire of goals and the re computation of the expire period had a < vs <= issue, leading to goals not expiring, while the period for the next expire was compute as 0 leading to a direct recall of the expire timer. In combination with sim time this lead to 100% CPU spikes. - The period of the expire timer was changed after the reset of the timer, leading to an incorrect next call time of the timer. - The timer was not canceled after the expire event was issued Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
|
Pulls: #1303 |
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
|
@Mergifyio backport jazzy |
✅ Backports have been createdDetails
Cherry-pick of 927a33e has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
* fix: Prevent short time endless loop in expire_timer There were multiple bugs in this area: - The expire of goals and the re computation of the expire period had a < vs <= issue, leading to goals not expiring, while the period for the next expire was compute as 0 leading to a direct recall of the expire timer. In combination with sim time this lead to 100% CPU spikes. - The period of the expire timer was changed after the reset of the timer, leading to an incorrect next call time of the timer. - The timer was not canceled after the expire event was issued Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * chore: Removed unneeded line Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> --------- Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com> (cherry picked from commit 927a33e) # Conflicts: # rcl_action/src/rcl_action/action_server.c
| RCUTILS_LOG_ERROR_NAMED( | ||
| ROS_PACKAGE_NAME, "_enqueue_check_expired_goals cancel of timer failed !"); |
There was a problem hiding this comment.
nitpick: the function name is part of the log already, see: https://docs.ros2.org/foxy/api/rcutils/structrcutils__log__location__t.html
https://docs.ros.org/en/rolling/p/rcutils/generated/structrcutils__log__location__s.html#exhale-struct-structrcutils-log-location-s
Also, we should probably avoid punctuation, exclamation, and extra whitespace:
| RCUTILS_LOG_ERROR_NAMED( | |
| ROS_PACKAGE_NAME, "_enqueue_check_expired_goals cancel of timer failed !"); | |
| RCUTILS_LOG_ERROR_NAMED(ROS_PACKAGE_NAME, "cancel of timer failed"); |
There was a problem hiding this comment.
#1307 if you think it's worth changing, otherwise feel free to close that pr.
There were multiple bugs in this area: