[21670] Fix Data Races on DDS-Pipe (backport #145)#152
Merged
Conversation
Author
|
Cherry-pick of ee0e639 has failed: 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 |
5c77c7d to
03d544b
Compare
* Refs #21670: Protect on_data_available_lambda_ Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Set listener in RederCreation Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Separate DDS/RTPS Listeners from Base Classes Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Uncrustify Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Apply Review Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Apply Review 2 Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Apply review 3 Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Avoid using capital letters in DDS Listener Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #21670: Fix leak Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> (cherry picked from commit ee0e639)
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
03d544b to
e524bd5
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 0.x #152 +/- ##
======================================
Coverage ? 34.11%
======================================
Files ? 155
Lines ? 7903
Branches ? 3517
======================================
Hits ? 2696
Misses ? 3283
Partials ? 1924 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Tools CI with this branch:
|
This file contains hidden or 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
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.
This PR is a follow up of eProsima/DDS-Router#509 to fix tsan tests of the DDS Router. It fixes two data races:
enabled_atomic boolean of theBaseReaderto ensure that theon_data_available_lambda_is only called when the class has been properly enabled, that is, when the lambda has already been set. This change is not mandatory, but TSAN stops reporting a false positive related to a data race with the the mentioned lambda .on_participant_discoverycallback and the destructor is avoided (data race on vptr (ctor/dtor vs virtual call)). This data rece occurs when a thread makes a call to a virtual method ("dds.udp"callslistener_->on_participant_discovery) while at the same time the destructor of the object that owns the virtual method is called (~CommonParticipant). Callingset_listener(nullptr)within the destructor does not prevent the data race, because the vtable is modified in the prologue of the destructor.set_listenerafter the Reader initialization.This is an automatic backport of pull request [21670] Fix Data Races on DDS-Pipe #145 done by Mergify.