fix: safely initialize exemplar reservoir storage#8524
Merged
jack-berg merged 2 commits intoJun 24, 2026
Merged
Conversation
|
|
4904d78 to
1d7232e
Compare
1d7232e to
990f3dd
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8524 +/- ##
=========================================
Coverage 78.51% 78.52%
- Complexity 8601 8603 +2
=========================================
Files 1013 1013
Lines 29148 29159 +11
Branches 3631 3635 +4
=========================================
+ Hits 22885 22896 +11
Misses 5420 5420
Partials 843 843 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jack-berg
approved these changes
Jun 23, 2026
jack-berg
approved these changes
Jun 24, 2026
Contributor
|
Thank you for your contribution @seongjun-rpls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes unsafe lazy initialization of
FixedSizeExemplarReservoirstorage.storageis initialized on the first offered measurement, but concurrent first measurements could observe a partially initialized or stale storage reference and fail with an NPE when recording into a bucket.This change safely publishes the initialized storage array and synchronizes the first initialization.
Fixes #8523
Testing
./gradlew :sdk:metrics:checkSince this is my first PR to this repository, I apologize in advance if I've missed anything or haven't fully followed the project's conventions. Please let me know and I'll be happy to make any changes needed.