-
Notifications
You must be signed in to change notification settings - Fork 789
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
Conversation
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@richiprosima please test this |
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@richiprosima Please test this |
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@richiprosima Please test this |
@Mergifyio backport 2.8.x 2.7.x 2.6.x |
✅ Backports have been created
|
{ | ||
return v == change; | ||
}); | ||
auto item = instance_changes.cbegin(); |
There was a problem hiding this comment.
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
…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>
…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
…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>
…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>
…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>
…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>
…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>
…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>
…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>
Description
mp_reader->nextUntakenCache()
inget_first_untaken_info()
is removing the change (it->remove_change()
) ifmatched_writer_lookup()
returns false. This, in turn callschange_removed_by_history()
butget_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 andtotal_unread_
variable are inconsistent and the issue arises.When user calls
take_next_sample()
,Ret::NO_DATA
is returned despitereader->get_unread_count()
is different from 0.Proposed solution
get_first_untaken_info()
should be a read-only API andmp_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
versions.md
file (if applicable).Reviewer Checklist