ros2 / rclc

ROS Client Library for the C language.
Apache License 2.0
118 stars 42 forks source link

rcl_send_response returns TIMEOUT #390

Closed fujitatomoya closed 3 weeks ago

fujitatomoya commented 1 year ago

Background

Since https://github.com/ros2/rcl/pull/1048 has been merged, rcl_send_response would return TIMEOUT. Because of the racy condition to establish the service topics between client and service server, there is time window that server cannot find the concerned client yet when server tries to send out the response. (This is well known issue, since ROS 2 service is constructed with 2 topics for Request and Response, not bidirectional transport socket like TCP.)

For rclcpp and rclpy, instead of generating exception, it proceeds the process with printing the warning message, so that executor can go on the process.

related fixes for rclcpp and rclpy.

Discussion

So the question is what we should do with rclc?

We can see executor returns error with rclc once this TIMEOUT happens via rcl_send_request. (e.g. rclc_executor_spin) That seems to be fine cz application can check the return code to re-enter the execution, but not exactly the same behavior with rclcpp and rclpy. We would probably want to the print warning just like rclcpp and then executor process should go on w/o returning to the application?

If above suggestion is okay, i am happy to create PR for that.

fujitatomoya commented 1 year ago

@JanStaschulat what do you think?