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

[17004] Fix performance tests - Overflow in received samples #3309

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

MRicoIE2CS
Copy link
Contributor

@MRicoIE2CS MRicoIE2CS commented Feb 16, 2023

Description

Samples sent and throughput value numbers suffer overflow.

How to reproduce:

Run colcon test for any of the following tests:

  • interprocess_reliable_shm
  • interprocess_reliable_udp

For payloads;demand:

  • 16;100
  • 8388608;100

And recoveries:

  • 0;10;20;30;40;50;60;70;80;90;100;

Fix performed

  • Fix overflow by counting received sampler directly instead of doing the following calculation, which is how it was done: counting lost samples comparing the sequence number of each received sample and the sequence number of the previous one, and then calculating received samples from last sequence number minus the count of lost samples.
  • Then, lost samples calculation is also done now from the calculation of sent samples minus the received samples, instead of the mentioned calculation in receiver.

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
  • [N/A] Any new/modified methods have been properly documented using Doxygen.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • [N/A] New feature has been added to the versions.md file (if applicable).
  • [N/A] 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

  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

…ot from calculation

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
…d of in Subscriber

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
@MRicoIE2CS MRicoIE2CS added bug Issue to report a bug needs-review PR that is ready to be reviewed labels Feb 16, 2023
Copy link
Contributor

@jsan-rt jsan-rt left a comment

Choose a reason for hiding this comment

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

Partial review pending thorough testing of the branch

test/performance/throughput/ThroughputSubscriber.cpp Outdated Show resolved Hide resolved
Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
@MiguelCompany MiguelCompany added this to the v2.10.0 milestone Feb 24, 2023
jsan-rt
jsan-rt previously approved these changes Feb 24, 2023
Copy link
Contributor

@jsan-rt jsan-rt left a comment

Choose a reason for hiding this comment

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

LGTM

@jsan-rt jsan-rt added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. ci-pending PR which CI is running and removed needs-review PR that is ready to be reviewed ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. labels Feb 28, 2023
@jsan-rt
Copy link
Contributor

jsan-rt commented Feb 28, 2023

@richiprosima please test this

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
@MRicoIE2CS
Copy link
Contributor Author

@richiprosima please test Windows and Mac again

@jsan-rt
Copy link
Contributor

jsan-rt commented Mar 1, 2023

@richiprosima please test linux

@jsan-rt
Copy link
Contributor

jsan-rt commented Mar 1, 2023

@richiprosima please test mac

@jsan-rt jsan-rt added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Mar 1, 2023
@EduPonz EduPonz merged commit 3fd318c into master Mar 3, 2023
@EduPonz EduPonz deleted the fix/performance_tests/received_samples_overflow branch March 3, 2023 09:05
roscan-tech pushed a commit to roscan-tech/Fast-DDS that referenced this pull request Sep 6, 2024
* Refs #17004: Fix overflow by counting received samples directly and not from calculation

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Cleaning

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Extend change to data_loans case

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Lost samples calculation is now done in Publisher instead of in Subscriber

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix over samples count for data_loans reception

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix data sizes

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix assert comparison

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Erase Windows warning

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

---------

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
roscan-tech pushed a commit to roscan-tech/Fast-DDS that referenced this pull request Sep 6, 2024
* Refs #17004: Fix overflow by counting received samples directly and not from calculation

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Cleaning

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Extend change to data_loans case

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Lost samples calculation is now done in Publisher instead of in Subscriber

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix over samples count for data_loans reception

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix data sizes

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Fix assert comparison

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

* Refs #17004: Erase Windows warning

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>

---------

Signed-off-by: Mikel Rico <mikelrico@eprosima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue to report a bug ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants