Fix datarace on WriterProxy stop while perform_initial_ack_nack [16041]#3046
Merged
MiguelCompany merged 5 commits intomasterfrom Nov 8, 2022
Merged
Fix datarace on WriterProxy stop while perform_initial_ack_nack [16041]#3046MiguelCompany merged 5 commits intomasterfrom
MiguelCompany merged 5 commits intomasterfrom
Conversation
Member
|
I think this introduces a deadlock. I would suggest adding a new API to TimedEvent that does the following: And call that one on |
35f0823 to
28401fd
Compare
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
046c1be to
11d4a3a
Compare
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
Member
|
@richiprosima Please test this |
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
Contributor
Author
|
@richiprosima Please test this |
MiguelCompany
requested changes
Nov 3, 2022
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
Member
|
@richiprosima Please test this |
MiguelCompany
added a commit
that referenced
this pull request
Nov 11, 2022
13 tasks
jparisu
pushed a commit
that referenced
this pull request
Dec 7, 2022
EduPonz
pushed a commit
that referenced
this pull request
Dec 12, 2022
MiguelCompany
added a commit
that referenced
this pull request
Dec 13, 2022
) * Revert "Revert #3046 (#3083)" This reverts commit a374872. * Add regression test Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * New writer proxies manipulation mutex Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Revert "New writer proxies manipulation mutex" This reverts commit b18a5272dd8f7d2bc1f01eda0134b8d572ea86a1. * Unlock reader's mutex before stopping WriterProxy Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Refs #16341. Fix link error on unit test Signed-off-by: Miguel Company <MiguelCompany@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Miguel Company <MiguelCompany@eprosima.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
roscan-tech
pushed a commit
to roscan-tech/Fast-DDS
that referenced
this pull request
Sep 6, 2024
…sima#3046) * Fix datarace on WriterProxy stop while perform_initial_ack_nack Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Add test Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Uncrustify Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Recreate timer only if being triggered Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> * Apply suggestions Signed-off-by: Juan López Fernández <juanlopez@eprosima.com> Signed-off-by: Juan López Fernández <juanlopez@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.
Signed-off-by: Juan López Fernández juanlopez@eprosima.com
Description
A WriterProxy can be stopped (and cleared) from the reception thread (PDP::remove_remote_participant -> WLP::removeRemoteEndpoints -> StatefulReader::matched_writer_remove) while this same WriterProxy is executing perform_initial_ack_nack callback on the events thread. Both methods (WriterProxy::clear and WriterProxy::perform_initial_ack_nack) may access the WriterProxy's attributes concurrently without protection.
Taking the reader's mutex from within the callback is one of the possible fixes, but it must be carefully checked whether this would introduce any deadlocks.
Alternative solutions are:
Contributor Checklist
versions.mdfile (if applicable).Reviewer Checklist