From 9bc4a4bd90e58ce5c9328883f60e96163c83a2a9 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Thu, 22 Aug 2024 16:38:00 +0100 Subject: [PATCH] Fix actions feedback race - https://github.com/ros2/rclcpp/issues/2451 --- rclcpp_action/src/client.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rclcpp_action/src/client.cpp b/rclcpp_action/src/client.cpp index c26cd723c8..62dd641c1f 100644 --- a/rclcpp_action/src/client.cpp +++ b/rclcpp_action/src/client.cpp @@ -355,16 +355,6 @@ ClientBase::is_ready(rcl_wait_set_t * wait_set) pimpl_->next_ready_event = ClientBaseImpl::NO_EVENT_READY; - if (is_feedback_ready) { - pimpl_->next_ready_event = static_cast(EntityType::FeedbackSubscription); - return true; - } - - if (is_status_ready) { - pimpl_->next_ready_event = static_cast(EntityType::StatusSubscription); - return true; - } - if (is_goal_response_ready) { pimpl_->next_ready_event = static_cast(EntityType::GoalClient); return true; @@ -380,6 +370,16 @@ ClientBase::is_ready(rcl_wait_set_t * wait_set) return true; } + if (is_feedback_ready) { + pimpl_->next_ready_event = static_cast(EntityType::FeedbackSubscription); + return true; + } + + if (is_status_ready) { + pimpl_->next_ready_event = static_cast(EntityType::StatusSubscription); + return true; + } + return false; }