Skip to content

[23847] Protect DataReaderInstance alive_writers attribute (backport #6123)#6160

Merged
MiguelCompany merged 2 commits into2.14.xfrom
mergify/bp/2.14.x/pr-6123
Nov 11, 2025
Merged

[23847] Protect DataReaderInstance alive_writers attribute (backport #6123)#6160
MiguelCompany merged 2 commits into2.14.xfrom
mergify/bp/2.14.x/pr-6123

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Nov 6, 2025

Description

This PR attempts to solve the data race produced in intraprocess scenario, when a writer sends a message from a thread (which updates its associated instance state in the reader receiving the message: DataReaderImpl::on_new_cache_change_added → DataReaderHistory::update_instance_nts → … → DataReaderInstance::writer_set), while from another thread the instances state of the same reader is also updated without protection (e.g., when destroying a matched writer: DataReaderImpl::update_subscription_matched_status → … → DataReaderInstance::writer_unregister). In the first thread the reader mutex is taken before calling update_instance_nts, the problem is that in the second thread that mutex is never taken.

@Mergifyio backport 3.3.x 3.2.x 2.14.x

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; 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)

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

  • 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.

  • 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 #6123 done by [Mergify](https://mergify.com).

Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
(cherry picked from commit 19d6a2b)

# Conflicts:
#	src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp
@mergify mergify Bot added the conflicts Backport PR wich git cherry pick failed label Nov 6, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Nov 6, 2025

Cherry-pick of 19d6a2b has failed:

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

You are currently cherry-picking commit 19d6a2b0.
  (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)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp

no changes added to commit (use "git add" and/or "git commit -a")

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

@MiguelCompany MiguelCompany added this to the v2.14.6 milestone Nov 6, 2025
@MiguelCompany MiguelCompany removed the conflicts Backport PR wich git cherry pick failed label Nov 6, 2025
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@MiguelCompany MiguelCompany self-requested a review November 6, 2025 10:05
@github-actions github-actions Bot added the ci-pending PR which CI is running label Nov 6, 2025
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Nov 6, 2025

🧪 CI Insights

Here's what we observed from your CI run for 60b45eb.

❌ Job Failures

Pipeline Job Health on 2.14.x Retries 🔍 CI Insights 📄 Logs
Fast-DDS MacOS CI mac-ci / fastdds_test () Unknown 0 View View

@emiliocuestaf emiliocuestaf added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Nov 11, 2025
@MiguelCompany MiguelCompany merged commit 5e0d695 into 2.14.x Nov 11, 2025
26 of 28 checks passed
@MiguelCompany MiguelCompany deleted the mergify/bp/2.14.x/pr-6123 branch November 11, 2025 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants