Closed mergify[bot] closed 4 months ago
Cherry-pick of df909438f4442afabc332364dba74c1612209c15 has failed:
On branch mergify/bp/2.14.x/pr-4822
Your branch is up to date with 'origin/2.14.x'.
You are currently cherry-picking commit df909438f.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: src/cpp/rtps/builtin/liveliness/WLP.cpp
modified: src/cpp/rtps/reader/StatefulReader.cpp
modified: src/cpp/rtps/reader/StatelessReader.cpp
modified: test/blackbox/common/BlackboxTestsLivelinessQos.cpp
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: include/fastdds/rtps/writer/LivelinessManager.h
both modified: src/cpp/rtps/writer/LivelinessManager.cpp
both modified: test/unittest/rtps/writer/LivelinessManagerTests.cpp
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
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
[X] Commit messages follow the project guidelines.
[X] The code follows the style guidelines of this project.
[X] 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
[X] Any new/modified methods have been properly documented using Doxygen.
NO Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
[X] Changes are backport compatible: they do NOT break ABI nor change library core behavior.
[X] Changes are API compatible.
NO New feature has been added to the
versions.md
file (if applicable).NO New feature has been documented/Current behavior is correctly described in the documentation.
[X] Applicable backports have been included in the description.
Reviewer Checklist
This is an automatic backport of pull request #4822 done by Mergify.