Skip to content
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

[15250] Fixing datarace on listener callbacks #2889

Merged
merged 10 commits into from
Aug 2, 2022

Conversation

MiguelBarro
Copy link
Contributor

@MiguelBarro MiguelBarro commented Jul 28, 2022

Signed-off-by: Miguel Barro miguelbarro@eprosima.com

Description

Avoid data races on listener callbacks by:

  • protecting DomainParticipantImpl getters and setters
  • protecting RTPSParticipantImpl getters and setters
  • Force ReceiverResource disable() method to wait for all concurrent callbacks.

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
  • Any new/modified methods have been properly documented using Doxygen.
  • Fast DDS test suite has been run locally.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • Documentation builds and tests pass locally.
  • New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.

Reviewer Checklist

  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

Miguel Barro added 3 commits July 28, 2022 08:38
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro
Copy link
Contributor Author

@richiprosima Please test this

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro
Copy link
Contributor Author

@richiprosima Please test this

…void linking error on ParticipantTests.

The test binary links to fastrtps which doesn't export the method thus it must rely on a header definition.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro MiguelBarro force-pushed the datarace/listener_callbacks branch 2 times, most recently from 3898974 to 01f1c21 Compare July 28, 2022 14:52
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro
Copy link
Contributor Author

@richiprosima Please test this

@MiguelBarro MiguelBarro marked this pull request as ready for review July 28, 2022 16:47
…f having the listener alive (as RTPS layer does)

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
@MiguelBarro
Copy link
Contributor Author

@richiprosima Please test this

@EduPonz
Copy link

EduPonz commented Aug 1, 2022

@richiprosima please test windows

@rsanchez15
Copy link
Contributor

rsanchez15 commented Aug 1, 2022

Locally checked that dataraces

  • #15250 - Disabling participant while raising a callback
  • #15251 - Setting listener to nullptr at deleting participant while raising a callback
  • #15252 - Setting listener while reading listener from RTPSParticipantImpl

are solved.

src/cpp/rtps/network/ReceiverResource.cpp Show resolved Hide resolved
src/cpp/rtps/participant/RTPSParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany
Copy link
Member

@richiprosima Please test this

src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
src/cpp/fastdds/domain/DomainParticipantImpl.cpp Outdated Show resolved Hide resolved
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany
Copy link
Member

@richiprosima Please test this

Copy link
Contributor

@jsan-rt jsan-rt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rsanchez15
Copy link
Contributor

Please check if dataraces 1140, 1142 and 1152 (from this sanitation-report) can be solved with this changes.

@MiguelCompany
Copy link
Member

Please check if dataraces 1140, 1142 and 1152 (from this sanitation-report) can be solved with this changes.

Those will be fixed in a follow-up PR

@MiguelCompany MiguelCompany merged commit 203e957 into master Aug 2, 2022
@MiguelCompany MiguelCompany deleted the datarace/listener_callbacks branch August 2, 2022 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants