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

[22722] Support interfaces for RPC generated code #5622

Open
wants to merge 15 commits into
base: feature/rpc/main
Choose a base branch
from

Conversation

MiguelCompany
Copy link
Member

Description

This adds the generic interfaces that the code generated by Fast DDS Gen for RPC interfaces will use.

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • N/A: Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • N/A: Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • NO: Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.
  • N/A: Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@MiguelCompany MiguelCompany changed the title [22722] Support interfaces for generated code [22722] Support interfaces for RPC generated code Jan 31, 2025
@MiguelCompany MiguelCompany added this to the v3.2.0 milestone Feb 4, 2025
*
* @param value The value to read the reply into.
*
* @return True if a reply was read, false if the feed has finished.
Copy link

Choose a reason for hiding this comment

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

For clarity should read: "false if the feed has finished or has been cancelled".

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed in 8827652

*
* @param value The value to read the reply into.
*
* @return True if a reply was read, false if the feed has finished.
Copy link

Choose a reason for hiding this comment

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

same as above

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed in 8827652

* Copy write operation.
*
* Will add a value to the input feed, that would be eventually sent to the server.
* May block depending on the configured queue sizes in both the client and the server.
Copy link

Choose a reason for hiding this comment

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

Is the queue size part of the default qos in fastdds when configured in either push/pull mode or is it an addition in the RPC implementation?

Copy link
Member Author

Choose a reason for hiding this comment

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

There will be new RpcClientQos and RpcServerQos classes that will compose a DataWriterQos and DataReaderQos inside. So the queue sizes mentioned here refer to the ones in the standard HISTORY and RESOURCE_LIMITS QoS

* @throw RpcBrokenPipeException if the communication with the client breaks.
* @throw RpcInputFeedCancelledException if the client cancels the input feed.
*/
virtual bool read(
Copy link

Choose a reason for hiding this comment

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

As an example:
In the event that a database is unable to receive more data due to a lack of storage space, how can this be propagated to the client that the server is unable to process more data?

T type;
while(read(type))
{
// I ran out of space, how do i signal this to the client?
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Throwing an exception defined in the IDL, which will be a child of RpcOperationError

Copy link
Member Author

Choose a reason for hiding this comment

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

See commit 57d9df2 for documentation improvement of RpcClientWriter

* @param value The value to write to the replies feed.
*
* @throw RpcBrokenPipeException if the communication with the client breaks.
* @throw RpcTimeoutException if the operation needs to block for a time longer than the configured timeout.
Copy link

Choose a reason for hiding this comment

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

Should this call not be able to throw RpcInputFeedCancelledException in the event that the reader prematurely calls cancel()? This also applies to the copy call above

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely right! I renamed the exception to RpcFeedCancelledException and changed the documentation of RpcServerWriter on 7fe135d and 1584639

Copy link

@mcheiva mcheiva left a comment

Choose a reason for hiding this comment

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

Initial EIVA review

@MiguelCompany
Copy link
Member Author

Initial EIVA review

@mcheiva I think I addressed all your comments. Could you re-review?

Copy link

@mcheiva mcheiva left a comment

Choose a reason for hiding this comment

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

We reviewed your answers to our comments, and it looks good! :)

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