-
Notifications
You must be signed in to change notification settings - Fork 7
[21670] Fix Data Races on DDS-Pipe (backport #145) #152
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
Conversation
|
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 ReportAttention: 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:
|
|
Tools CI with this branch:
|
juanlofer-eprosima
left a comment
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
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.