Fix routing loop of Service request when client and server are server by the same bridge #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In case a Service Server and a Client for the same Service are running in the same domain and discovered by the same bridge, the Client can directly communicate with the Server. Nevertheless, the bridge is also routing the Client's request to the Server, leading to a duplicate request received by the Server.
It seems to not cause an issue for lot of ROS Services Server (the Client will drop the 2nd reply anyway).
But for Lifecycle Nodes that are based on Services for state transitions, this leads to some error messages
E.g. to reproduce with lifecycle demo on a single host:
ros2 run lifecycle lifecycle_talker
ros2 run lifecycle lifecycle_listener
zenoh-bridge-ros2dds
ros2 run lifecycle lifecycle_service_client
On
Transition 3
this error message shows up forlifecycle_talker
:This PR fixes that making sure that the Client Request when routed by the bridge as a Zenoh query doesn't loop back to the same bridge (using
.allowed_destination(Locality::Remote)
)The PR also improve requests/replies routing logs and operation names for clarity.