Skip to content

[#25837] Fix callback synchronization race - #210

Open
Danipiza wants to merge 1 commit into
mainfrom
fix/internalreader_dispatch
Open

Danipiza wants to merge 1 commit into
mainfrom
fix/internalreader_dispatch

Conversation

@Danipiza

Copy link
Copy Markdown
Contributor

Description

Previously, two threads could do this concurrently:

  1. One thread started invoking the reader’s callback.
  2. Another thread disabled the reader, removed the callback, and destroyed the route owning its target.
  3. The first thread could continue using that destroyed target.

Callback registration/removal used the BaseReader mutex, but reception and dispatch used the queue mutex. Those different locks did not protect the callback’s lifetime. That is why your original probe still reported true.

Fix

Holds the BaseReader mutex through callback dispatch, making disable/removal wait for an active invocation.

Signed-off-by: danipiza <dpizarrogallego@gmail.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.85%. Comparing base (e9c1e26) to head (16a2ed2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...cipants/src/cpp/reader/auxiliar/InternalReader.cpp 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
- Coverage   41.07%   40.85%   -0.23%     
==========================================
  Files         161      164       +3     
  Lines        7651     7723      +72     
  Branches     3062     3099      +37     
==========================================
+ Hits         3143     3155      +12     
- Misses       2794     2834      +40     
- Partials     1714     1734      +20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch was previously deployed

1 inactive deployment
codecov — 16a2ed2a Deployed Nov 16, 2026 by Danipiza via reusable_tests / coverage #1588
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.

2 participants