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

Use reqid and not ID #40

Closed
wants to merge 1 commit into from
Closed

Use reqid and not ID #40

wants to merge 1 commit into from

Conversation

stevenhartley
Copy link

response reqid is the same as the request.id so we need to use this in lieu of id.

Open source gods please forgive me for no test....

response reqid is the same as the request.id so we need to use this in lieu of id.
Copy link
Contributor

@gregmedd gregmedd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me.

I have used the RPC client / server in the example repo to check that this does not introduce any new issues that were not already present. Full confirmation will require changes from #34.

For the sake of record keeping, tests are missing because the relevant test (testRpcClient) is known to be broken right now. We are actively working to address that.

Copy link
Contributor

@debruce debruce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just gone back and retested everything, and I'm certain that, either this check is not needed, or it would need to made with an associated change in QueryHandler. I've put inline comments at the two code sites in my PR. To reiterate that here, the purpose of the queryMap_ is to tranport the zenoh z_query_t from the incoming zenoh call to the place in sendQueryable() (called from onReceive()) where its needed for reply. The zenoh call-reply is not based on uProtocol attributes. The only role of the id() or reqid() is its uniqueness as a map key.
In the long run, this queryMap_ should be removed. A better mechanism should be provided to pass the z_query_t around the onReceive() opaqueness. One such mechanism is thread local storage. There is no reason to slow the rpc code down with unnecessary associative array lookups.
Also, when reqid() was used, it appeared to be all zeros coming from the client side, and that would not be a useful unique key. I think that is probably expected, but I will confirm that again.

Copy link
Contributor

@debruce debruce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@stevenhartley
Copy link
Author

No longer needed, got pulled in from #34 that was merged

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

Successfully merging this pull request may close these issues.

3 participants