Skip to content

Commit

Permalink
rcl_send_response returns RCL_RET_TIMEOUT.
Browse files Browse the repository at this point in the history
part of ros2/ros2#1253

We hit this problem where a broken client crashes the service executor.
With this change we can fix it in rclcpp.

Note: this is same as #1048 which is not been taken attention for a
while.

Signed-off-by: Zang MingJie <zealot0630@gmail.com>
  • Loading branch information
kghost committed Jun 16, 2023
1 parent 230ae2f commit d8faa66
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rcl/src/rcl/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,12 @@ rcl_send_response(
const rcl_service_options_t * options = rcl_service_get_options(service);
RCL_CHECK_FOR_NULL_WITH_MSG(options, "Failed to get service options", return RCL_RET_ERROR);

if (rmw_send_response(
service->impl->rmw_handle, request_header, ros_response) != RMW_RET_OK)
{
rmw_ret_t ret = rmw_send_response(service->impl->rmw_handle, request_header, ros_response);
if (ret != RMW_RET_OK) {
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
if (ret == RMW_RET_TIMEOUT) {
return RCL_RET_TIMEOUT;
}
return RCL_RET_ERROR;
}

Expand Down

0 comments on commit d8faa66

Please sign in to comment.