Skip to content

[21670] Avoid Data Race in Reader Locator (backport #5833)#5841

Merged
cferreiragonz merged 3 commits into2.14.xfrom
mergify/bp/2.14.x/pr-5833
Jun 17, 2025
Merged

[21670] Avoid Data Race in Reader Locator (backport #5833)#5841
cferreiragonz merged 3 commits into2.14.xfrom
mergify/bp/2.14.x/pr-5833

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented May 30, 2025

Description

This PR modifies find_local_reader method to assign the local_reader shared pointer within the function, instead of returning the value. In this way, all operations are protected by the RTPSDomain mutex and no data race can occur.

This Data Race is reported by DDS Router CI.

Contributor Checklist

  • Commit messages follow the project guidelines.

  • The code follows the style guidelines of this project.

  • N/A Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally

  • N/A Any new/modified methods have been properly documented using Doxygen.

  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)

  • N/A Changes are backport compatible: they do NOT break ABI nor change library core behavior.

  • N/A Changes are API compatible.

  • N/A New feature has been added to the versions.md file (if applicable).

  • N/A New feature has been documented/Current behavior is correctly described in the documentation.

  • N/A Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

This is an automatic backport of pull request #5833 done by [Mergify](https://mergify.com).

* Refs #21670: Avoid Data Race in Reader Locator

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #21670: Apply review

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
(cherry picked from commit e15acec)

# Conflicts:
#	test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp
@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented May 30, 2025

Cherry-pick of e15acec has failed:

On branch mergify/bp/2.14.x/pr-5833
Your branch is up to date with 'origin/2.14.x'.

You are currently cherry-picking commit e15acecd.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/cpp/rtps/RTPSDomain.cpp
	modified:   src/cpp/rtps/RTPSDomainImpl.hpp
	modified:   src/cpp/rtps/writer/ReaderLocator.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp

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

@mergify mergify bot added the conflicts Backport PR wich git cherry pick failed label May 30, 2025
@mergify mergify bot mentioned this pull request May 30, 2025
8 tasks
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@MiguelCompany MiguelCompany removed the conflicts Backport PR wich git cherry pick failed label May 30, 2025
@MiguelCompany MiguelCompany added this to the v2.14.5 milestone May 30, 2025
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima June 16, 2025 14:35
@github-actions github-actions bot added the ci-pending PR which CI is running label Jun 16, 2025
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima June 16, 2025 14:55
@cferreiragonz cferreiragonz merged commit 315ac5c into 2.14.x Jun 17, 2025
18 checks passed
@cferreiragonz cferreiragonz deleted the mergify/bp/2.14.x/pr-5833 branch June 17, 2025 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-pending PR which CI is running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants