[21670] Fix Data Races on DDS-Pipe#145
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
==========================================
+ Coverage 36.49% 37.96% +1.46%
==========================================
Files 170 154 -16
Lines 11657 7020 -4637
Branches 5327 2788 -2539
==========================================
- Hits 4254 2665 -1589
+ Misses 4645 2954 -1691
+ Partials 2758 1401 -1357 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
434c27d to
2c5867a
Compare
2c5867a to
d355648
Compare
d355648 to
02d98d0
Compare
02d98d0 to
d2459fc
Compare
juanlofer-eprosima
requested changes
Jun 18, 2025
6d773c9 to
5a88189
Compare
19d1482 to
0725efa
Compare
Contributor
Author
|
As internally agreed, I have disabled the auto-enabling of the DataReader at DDS level and now we manually enable it. This is not mandatory tho, it only protects against highly unlikely changes in future Fast DDS releases. |
juanlofer-eprosima
requested changes
Jul 10, 2025
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
0725efa to
71631b6
Compare
Contributor
Author
|
Revision applied on commit 71631b6. I also rebased on top of master |
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Contributor
Author
|
@Mergifyio backport 0.x |
✅ Backports have been createdDetails
|
mergify Bot
pushed a commit
that referenced
this pull request
Jul 14, 2025
* 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) # Conflicts: # ddspipe_participants/include/ddspipe_participants/participant/dds/CommonParticipant.hpp # ddspipe_participants/include/ddspipe_participants/participant/dynamic_types/DynTypesParticipant.hpp # ddspipe_participants/include/ddspipe_participants/participant/rtps/CommonParticipant.hpp # ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp # ddspipe_participants/src/cpp/participant/dynamic_types/DynTypesParticipant.cpp # ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp # ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp
cferreiragonz
added a commit
that referenced
this pull request
Jul 14, 2025
* 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)
juanlofer-eprosima
pushed a commit
that referenced
this pull request
Jul 15, 2025
* Fix Data Races on DDS-Pipe (#145) * 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) * Fix conflicts Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> Co-authored-by: Carlos Ferreira González <carloos.499@gmail.com> Co-authored-by: cferreiragonz <carlosferreira@eprosima.com>
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.