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

[16608] Fix total_unread_ consistent with reader's history upon get_first_untaken_info() #3203

Merged
merged 6 commits into from
Jan 17, 2023

Conversation

Mario-DL
Copy link
Member

Description

mp_reader->nextUntakenCache() in get_first_untaken_info() is removing the change (it->remove_change()) if matched_writer_lookup() returns false. This, in turn calls change_removed_by_history() but get_last_notified() returns always false in that case because no writerGUID is found, hence a sequence number of 0.0 is returned.

This situation causes that total_unread_ is not decremented despite removing the change, so the history size and total_unread_ variable are inconsistent and the issue arises.

When user calls take_next_sample(), Ret::NO_DATA is returned despite reader->get_unread_count() is different from 0.

Proposed solution

get_first_untaken_info() should be a read-only API and mp_reader->nextUntakenCache() should not be called from inside because it modifies the history in certain cases.

@Mergifyio backport 2.8.x 2.7.x 2.6.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
  • Any new/modified methods have been properly documented using Doxygen.
  • Fast DDS test suite has been run locally.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • N/A Documentation builds and tests pass locally.
  • 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.
  • 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.

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@Mario-DL Mario-DL added needs-review PR that is ready to be reviewed ci-pending PR which CI is running labels Jan 11, 2023
@Mario-DL Mario-DL changed the title [16608] total_unread_ consistent with reader's history upon get_first_untaken_info() [16608] Fix total_unread_ consistent with reader's history upon get_first_untaken_info() Jan 11, 2023
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@Mario-DL
Copy link
Member Author

@richiprosima please test this

@Mario-DL Mario-DL removed the ci-pending PR which CI is running label Jan 16, 2023
test/blackbox/common/DDSBlackboxTestsBasic.cpp Outdated Show resolved Hide resolved
test/blackbox/common/DDSBlackboxTestsBasic.cpp Outdated Show resolved Hide resolved
test/blackbox/common/DDSBlackboxTestsBasic.cpp Outdated Show resolved Hide resolved
test/blackbox/common/DDSBlackboxTestsBasic.cpp Outdated Show resolved Hide resolved
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
MiguelCompany
MiguelCompany previously approved these changes Jan 16, 2023
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

LGTM

@MiguelCompany MiguelCompany added ci-pending PR which CI is running and removed needs-review PR that is ready to be reviewed labels Jan 16, 2023
@MiguelCompany
Copy link
Member

@richiprosima Please test this

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

👍

@MiguelCompany
Copy link
Member

@richiprosima Please test this

@MiguelCompany MiguelCompany merged commit de5cd9c into master Jan 17, 2023
@MiguelCompany MiguelCompany deleted the bugfix/16608 branch January 17, 2023 13:11
@MiguelCompany
Copy link
Member

@Mergifyio backport 2.8.x 2.7.x 2.6.x

@mergify
Copy link
Contributor

mergify bot commented Jan 17, 2023

{
return v == change;
});
auto item = instance_changes.cbegin();
Copy link
Contributor

Choose a reason for hiding this comment

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

this item could be NULL? see ros2/rmw_fastrtps#659

fujitatomoya added a commit that referenced this pull request Jan 17, 2023
…first_untaken_info (#3203)"

This reverts commit de5cd9c.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
MiguelCompany pushed a commit that referenced this pull request Jan 17, 2023
…first_untaken_info (#3203)" (#3221)

This reverts commit de5cd9c.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
MiguelCompany pushed a commit that referenced this pull request Jan 18, 2023
…taken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Mario-DL added a commit that referenced this pull request Jan 18, 2023
…taken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)

# Conflicts:
#	test/blackbox/api/dds-pim/PubSubReader.hpp
EduPonz pushed a commit that referenced this pull request Jan 18, 2023
…taken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Mario-DL added a commit that referenced this pull request Jan 18, 2023
…taken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Mario-DL added a commit that referenced this pull request Jan 18, 2023
…taken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jan 19, 2023
…taken_info (#3223)

* Fix total_unread_ consistent with reader's history after get_first_untaken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608. Reversed unnecessary changes on DDSBlackboxTestsBasic

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Not using shared pointer for PubSubReader and PubSubWriter.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved test.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved solution.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Fix linters.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
MiguelCompany added a commit that referenced this pull request Jan 25, 2023
…aken_info() (#3219)

* Fix total_unread_ consistent with reader's history after get_first_untaken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)

# Conflicts:
#	test/blackbox/api/dds-pim/PubSubReader.hpp

* Refs #16608. Reversed unnecessary changes on DDSBlackboxTestsBasic

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Not using shared pointer for PubSubReader and PubSubWriter.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved test.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved solution.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Linter && Removed conflict marks

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
Co-authored-by: Miguel Company <MiguelCompany@eprosima.com>
Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jan 25, 2023
…aken_info() (#3218)

* Fix total_unread_ consistent with reader's history after get_first_untaken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Removed conflicts

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608. Reversed unnecessary changes on DDSBlackboxTestsBasic

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Not using shared pointer for PubSubReader and PubSubWriter.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved test.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved solution.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Linter

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Removed Multithreaded test from DDSBlackBoxTestsBasic

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
Co-authored-by: Miguel Company <MiguelCompany@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jan 25, 2023
…aken_info() (#3217)

* Fix total_unread_ consistent with reader's history after get_first_untaken_info (#3203)

* Refs 16608: Added BlackBoxTest

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs 16608: Fix. Make get_first_untaken_info() a read-only API call

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Fix tsan warning

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Applied second-reviewed suggested changes

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608: Skip test for Data-Sharing

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit de5cd9c)
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Resolved conflicts

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #16608. Reversed unnecessary changes on DDSBlackboxTestsBasic

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Not using shared pointer for PubSubReader and PubSubWriter.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved test.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs #16608. Improved solution.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Linter

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
Co-authored-by: Miguel Company <MiguelCompany@eprosima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-pending PR which CI is running
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants