From 9d481f7cda8150fa7bafc5084bd06881bee61aec Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Fri, 26 Jun 2026 16:12:17 +0200 Subject: [PATCH] Fix GoalStream waiter resumption in action send_goal flow --- rclcpp_async/include/rclcpp_async/co_context.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rclcpp_async/include/rclcpp_async/co_context.hpp b/rclcpp_async/include/rclcpp_async/co_context.hpp index fc96ed7..61b4802 100644 --- a/rclcpp_async/include/rclcpp_async/co_context.hpp +++ b/rclcpp_async/include/rclcpp_async/co_context.hpp @@ -500,12 +500,7 @@ void SendGoalAwaiter::await_suspend(std::coroutine_handle<> h) state->stream->client_ = client; state->result = Result>>::Ok(state->stream); } - // Use post() instead of resume() to defer coroutine resumption. - // rclcpp_action holds goal_requests_mutex during this callback - // (Jazzy bug: https://github.com/ros2/rclcpp/issues/2796). - // Resuming synchronously here would deadlock if the coroutine - // immediately calls async_send_goal again. - ctx.post([&ctx, h]() { ctx.resume(h); }); + ctx.resume(h); }; client->async_send_goal(goal, options);