Skip to content

[SDK] Convert SpinLockMutex to std::mutex part 1 - #4323

Merged
marcalff merged 11 commits into
open-telemetry:mainfrom
dbarker:sdk_swap_spinlock_for_mutex_part_1
Aug 5, 2026
Merged

marcalff merged 11 commits into
open-telemetry:mainfrom
dbarker:sdk_swap_spinlock_for_mutex_part_1

Conversation

@dbarker

@dbarker dbarker commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Contributes to #4317

Spinlocks are not a fit for the use cases in classes covered by this PR. See #4317 for rationale.

Changes

Converts SpinLockMutex to std::mutex in:

  • SimpleProcessor
  • SimpleLogRecordProcessor
  • MeterContext
  • Meter

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

{
if (exporter_ != nullptr)
{
return exporter_->ForceFlush(timeout);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ForceFlush and Shutdown are not covered by the lock. Export needs to check IsShutdown and log an error on export failure. A followup PR is needed.

@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.86%. Comparing base (cdef407) to head (8f3b3eb).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4323   +/-   ##
=======================================
  Coverage   80.86%   80.86%           
=======================================
  Files         450      450           
  Lines       19216    19216           
=======================================
  Hits        15537    15537           
  Misses       3679     3679           
Files with missing lines Coverage Δ
...entelemetry/sdk/logs/simple_log_record_processor.h 100.00% <ø> (ø)
sdk/include/opentelemetry/sdk/metrics/meter.h 57.15% <ø> (ø)
...include/opentelemetry/sdk/trace/simple_processor.h 100.00% <100.00%> (ø)
sdk/src/logs/simple_log_record_processor.cc 100.00% <100.00%> (ø)
sdk/src/metrics/meter.cc 81.36% <100.00%> (ø)
sdk/src/metrics/meter_context.cc 92.78% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbarker
dbarker marked this pull request as ready for review July 31, 2026 23:47
@dbarker
dbarker requested a review from a team as a code owner July 31, 2026 23:47
@dbarker dbarker added the pr:please-review This PR is ready for review label Aug 2, 2026

@marcalff marcalff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcalff
marcalff merged commit 9c0cee5 into open-telemetry:main Aug 5, 2026
122 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please-review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants