Skip to content

Two phase cleanup for Listener Objects#6075

Open
Santhosha-bk wants to merge 3 commits into
mainfrom
santhoshab/ListenerFix
Open

Two phase cleanup for Listener Objects#6075
Santhosha-bk wants to merge 3 commits into
mainfrom
santhoshab/ListenerFix

Conversation

@Santhosha-bk

@Santhosha-bk Santhosha-bk commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed registration shutdown listener race by safely snapshotting listeners before stopping them.

During registration shutdown, listeners are now drained from the shared registration list under lock, and each listener is conditionally pinned with a non-zero refcount acquire. Only successfully pinned listeners are moved to a private pending list, then stopped outside the lock and released afterward.

This prevents shutdown from touching listeners that concurrently reached refcount zero, avoids stale-list traversal risks, and keeps listener lifetime handling safe under concurrent close/shutdown interleaving's.

Fixes : https://microsoft.visualstudio.com/OS/_workitems/edit/61981303/

Testing

Documentation

N/A

@Santhosha-bk Santhosha-bk requested a review from guhetier June 8, 2026 11:40
@Santhosha-bk Santhosha-bk requested a review from a team as a code owner June 8, 2026 11:40
Comment thread src/core/registration.c Outdated
Comment thread src/core/registration.c Outdated
Comment thread src/core/registration.c Outdated
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.69%. Comparing base (6525fb3) to head (d6c9d7e).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/core/registration.c 36.36% 7 Missing ⚠️

❌ Your patch check has failed because the patch coverage (36.36%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6075      +/-   ##
==========================================
- Coverage   85.93%   84.69%   -1.25%     
==========================================
  Files          60       60              
  Lines       18798    18847      +49     
==========================================
- Hits        16155    15963     -192     
- Misses       2643     2884     +241     

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

guhetier
guhetier previously approved these changes Jun 11, 2026
Comment thread src/core/registration.c Outdated
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