Client (async_send_request) could not return when the data (message) is lost
@wjwwood is already working on this.
Since Feb 6, 2019.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
In ROS2 client, if the message is lost, the client function async_send_request will not return any more. I try to solve the problem in rmw level and hack the code in function rmw_take_response to return RMW_RET_ERROR if the message is lost, but it doesn't work.
The reason is that:
In function Executor::execute_client:
if (status == RCL_RET_OK) {
client->handle_response(request_header, response);
} else if (status != RCL_RET_CLIENT_TAKE_FAILED) {
fprintf(stderr,
"[rclcpp::error] take response failed for client of service '%s': %s\n",
client->get_service_name().c_str(), rcl_get_error_string_safe());
rcl_reset_error();
}
If the return value is Error, the function handle_response could not be executed.
However, in function handle_response
{
// ...
call_promise->set_value(typed_response);
callback(future);
}
If the callback(future) is not executed, the async_send_request will not return f.
So I wonder if this problem can be solved in rclcpp? Because in our implementation in rmw, the message may be lost.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.