-
Notifications
You must be signed in to change notification settings - Fork 783
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
[21065] Bugfix: correct liveliness state in a multiple reader - one writer scenario #4822
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Mario-DL
requested review from
MiguelCompany
and removed request for
MiguelCompany
May 30, 2024 09:14
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Mario-DL
requested review from
MiguelCompany
and removed request for
richiprosima and
MiguelCompany
May 30, 2024 10:35
@richiprosima Please test_3 this |
MiguelCompany
requested changes
May 30, 2024
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.
Just a small nit, can be applied without running CI again
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@richiprosima Please test_3 linux |
elianalf
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
May 31, 2024
MiguelCompany
approved these changes
May 31, 2024
@Mergifyio backport 2.14.x 2.13.x 2.10.x 2.6.x |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
May 31, 2024
…s on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp
mergify bot
pushed a commit
that referenced
this pull request
May 31, 2024
…s on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp
mergify bot
pushed a commit
that referenced
this pull request
May 31, 2024
…s on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp
This was referenced May 31, 2024
mergify bot
pushed a commit
that referenced
this pull request
May 31, 2024
…s on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp
12 tasks
EduPonz
pushed a commit
that referenced
this pull request
Jun 5, 2024
…enario (#4822) (#4881) * Correctly call `on_liveliness_changed` when there are multiple readers on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp * Solve conflicts Signed-off-by: Mario Dominguez <mariodominguez@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: Mario Dominguez <mariodominguez@eprosima.com>
EduPonz
pushed a commit
that referenced
this pull request
Jun 5, 2024
…enario (#4822) (#4884) * Correctly call `on_liveliness_changed` when there are multiple readers on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp * Solve conflicts Signed-off-by: Mario Dominguez <mariodominguez@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: Mario Dominguez <mariodominguez@eprosima.com>
MiguelCompany
pushed a commit
that referenced
this pull request
Jun 6, 2024
…on the same topic (#4822) (#4882) * Correctly call `on_liveliness_changed` when there are multiple readers on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp * Solve conflicts Signed-off-by: Mario Dominguez <mariodominguez@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: Mario Dominguez <mariodominguez@eprosima.com>
MiguelCompany
pushed a commit
that referenced
this pull request
Jun 10, 2024
…s on the same topic (#4822) (#4883) * Correctly call `on_liveliness_changed` when there are multiple readers on the same topic (#4822) * Refs #21065: Add BB test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Add fix rework after sync with Miguel Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * REfs #21065: Correct windows NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21065: Apply NIT Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit df90943) # Conflicts: # include/fastdds/rtps/writer/LivelinessManager.h # src/cpp/rtps/writer/LivelinessManager.cpp # test/unittest/rtps/writer/LivelinessManagerTests.cpp * Solve conflicts Signed-off-by: Mario Dominguez <mariodominguez@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: Mario Dominguez <mariodominguez@eprosima.com>
12 tasks
This was referenced Jul 4, 2024
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR corrects a misbehavior given in a single writer - multiple readers scenario. When the writer is destroyed, the
WriterProxy
is removed from readers. When it is removed from the first one, theLivelinessManager::remove_writer()
returnsfalse
as--writer.count
is1
, hence theliveliness_changed
callback is not triggered (callback_
withinLivelinessManager
is not invoked). When theWriterProxy
is deleted from the second reader, theLivelinessManager::remove_writer()
correctly removes the writer and fires thecallback
. The problem in this case is that, later, inWLP::sub_liveliness_changed()
theupdate_liveliness_changed_status()
is only called for this later reader, since the first one is not matched anymore andreader->matched_writer_is_matched()
returnsfalse
, corrupting its liveliness state. In this situation, if the writer wakes up again, the first reader is going to return analive_count
of2
instead of1
.The fix proposes that every time we unpair a
WriterProxy
from a reader, we should also update the liveliness state for that particular reader. The solution tries to avoid defining extra collections for tracking readers/writers.@Mergifyio backport 2.14.x 2.13.x 2.10.x 2.6.x
Fixes #4610
Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist