Skip to content

Replace RwLock by OnceLock for transport callback#2381

Merged
OlivierHecart merged 2 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:transport-callback-oncelock
May 12, 2026
Merged

Replace RwLock by OnceLock for transport callback#2381
OlivierHecart merged 2 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:transport-callback-oncelock

Conversation

@wyfo
Copy link
Copy Markdown
Contributor

@wyfo wyfo commented Jan 20, 2026

Callback is set only once after the transport creation. Using the right primitive, e.g. a OnceLock gives better performance, as it just do an atomic load instead of a atomic RMWs of RwLock.


🏷️ Label-Based Checklist

Based on the labels applied to this PR, please complete these additional requirements:

Labels: internal

🏠 Internal Change

This PR is marked as internal (not user-facing):

  • No API changes - Public APIs unchanged
  • No behavior changes - External behavior identical
  • Refactoring/maintenance - Code improvements only
  • Tests still pass - All existing tests pass without modification

Lighter review: Internal changes may have lighter review requirements.

Instructions:

  1. Check off items as you complete them (change - [ ] to - [x])
  2. The PR checklist CI will verify these are completed

This checklist updates automatically when labels change, but preserves your checked boxes.

@wyfo wyfo added the internal Changes not included in the changelog label Jan 20, 2026
@wyfo wyfo requested a review from yellowhatter January 20, 2026 09:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.47%. Comparing base (3c77c34) to head (219e18c).
⚠️ Report is 23 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2381      +/-   ##
==========================================
+ Coverage   71.91%   72.47%   +0.55%     
==========================================
  Files         390      390              
  Lines       62764    63283     +519     
==========================================
+ Hits        45139    45864     +725     
+ Misses      17625    17419     -206     

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

@wyfo wyfo force-pushed the transport-callback-oncelock branch 2 times, most recently from 1b8a25a to 5f5ad96 Compare May 12, 2026 14:59
@wyfo wyfo force-pushed the transport-callback-oncelock branch from b8700c3 to f7ac78d Compare May 12, 2026 15:10
@OlivierHecart OlivierHecart merged commit d879f6c into eclipse-zenoh:main May 12, 2026
20 of 24 checks passed
@OlivierHecart OlivierHecart deleted the transport-callback-oncelock branch May 12, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Changes not included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants