Skip to content
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

Ability to record all messages and message types over all UAuthority #32

Open
PLeVasseur opened this issue Apr 25, 2024 · 4 comments
Open

Comments

@PLeVasseur
Copy link
Contributor

Hey @evshary -- I think in support of the up-zenoh-recorder we'll need the ability to listen for all messages coming over all authorities.

Seems like to me we could accomplish this with handing in an empty UUri, i.e. even the UAuthority is empty for now when calling register_listener().

i.e.

let recording_uuri = UUri::default();
recorder_up_client.register_listener(recording_uuri, my_recording_listener);

I think this would be able to handle the use-case of passively listening for Publish, Notification, and Request message types.

Publish & Notification

Publish and Notification are straight-forward, since they use the Zenoh Subscriber pattern.

Request

For the Request message type we would just be sure not to send a Response, so as to not "compete" with the actual service listening on that UUri.

Response

However, I'm unclear on how we would be able to passively listen to the Response message type, since in Zenoh terminology, when we handle a Request message we call reply on the query. It seems to me like there's nothing sort of "externally visible" for the uRecorder to be able to see when that happens. But maybe I'm wrong and my test case is wrong.

  • Could you help me understand if the uRecorder would be able to see the Response as well when it's sent up by a service?

Test Code

I opened a draft PR over here to show the test code which is failing.

@evshary
Copy link
Contributor

evshary commented Apr 26, 2024

No, I don't think we can record the response from Zenoh reply currently.

Maybe one workaround is just like ROS 2. The RPC Server should also publish the same message which it wants to reply.
Then the recorder can also receive that message.
https://github.com/ros-infrastructure/rep/pull/360/files

@Mallets Do you have any ideas about this?

@PLeVasseur
Copy link
Contributor Author

No, I don't think we can record the response from Zenoh reply currently.

Maybe one workaround is just like ROS 2. The RPC Server should also publish the same message which it wants to reply.
Then the recorder can also receive that message.
https://github.com/ros-infrastructure/rep/pull/360/files

Would the idea be that under the hood in UPClientZenoh when send_response() is called when a service provider calls send() with a Response message, within send_response() a normal Zenoh publish is used to also transmit the Response message so that it's visible to the uRecorder?

It's sending an extra Zenoh publish out each time a service provider sends a Response message.

Is that roughly correct or is there more to it?

@evshary
Copy link
Contributor

evshary commented Apr 27, 2024

Yes, that's the whole concept.

@PLeVasseur
Copy link
Contributor Author

Okay, thanks for clarifying. Let's bring this to the uProtocol Zenoh weekly to discuss a plan. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants