-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[service client] no indication if server crashes during or before processing of service call #367
Comments
I think this is a use-case for the deadline and/or liveliness quality of service settings (described in this pending PR). If your application requires a timely response from the service (deadline) and/or needs to ensure that the service is always available (liveliness) then you can set the appropriate QoS settings. Currently, deadline and liveliness QoS settings aren't supported for services or actions, but I expect there might be a follow-up to ros2/ros2#680 at some point. In the meantime you might be able to use the client's |
@jacobperron thanks for the response. Sorry for the confusion -- I agree it doesn't seem necessary in the CLI. I was trying to understand if the ability was present in the underlying library at all. Coming from higher level network programming, I am used to making requests where the callback handler is invoked with an error if the connection breaks or the peer dies. My understanding is that liveliness is not implemented in fastrtps and deadlines are not implemented for service calls. So, am I correct in assuming the only way to detect this scenario is for the client to send a request and then wait a certain period of time and assume the server failed or dropped it, if it gets no response in this time period? |
I believe you are correct. Besides the timeout, you should also be able to use the client method, |
Bug report
Required Info:
Steps to reproduce issue
Run this example server (which crashed when you send a request)
Call this with rclpy client (or
ros2 service call /mock/add_two_ints example_interfaces/srv/AddTwoInts '{a: 3, b: 34}'
).Expected behavior
When the node crashes/dies, the client should get some sort of notification that the service failed.
Actual behavior
The client will wait for the response forever. I have not found any way to deal with this. This also happens if you call the service when it is not ready. This could be an issue because there is a very real race condition between checking
client.service_is_ready()
and actually making the call.Additional information
Not sure if this is a bug, or just a feature that hasn't been implemented. This seems like a very likely failure to occur in practice and should be deal with.
If this is not a bug and just a missing feature, I am happy to work on it and send a PR if someone points me to where I should i get started with it.
The text was updated successfully, but these errors were encountered: