Fix #1663 Threading issue between Meter::RegisterSyncMetricStorage and Meter::Collect#1666
Merged
Merged
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1666 +/- ##
==========================================
+ Coverage 84.97% 85.76% +0.79%
==========================================
Files 170 170
Lines 5134 5137 +3
==========================================
+ Hits 4362 4405 +43
+ Misses 772 732 -40
|
Member
Author
|
This is ready for review now. |
esigo
reviewed
Oct 10, 2022
Member
esigo
left a comment
There was a problem hiding this comment.
Thanks for the fix.
It would be great if you could make sure at least some of the threads finish in the unit test.
For example each thread can increment a counter when they start and decrement it when they finish.
esigo
reviewed
Oct 10, 2022
…into fix-race-meter
Member
Author
Have added logic to make threads to join before finishing the unit test. Hope it suffices. |
ThomsonTan
reviewed
Oct 10, 2022
esigo
approved these changes
Oct 11, 2022
ThomsonTan
approved these changes
Oct 11, 2022
yxue
pushed a commit
to yxue/opentelemetry-cpp
that referenced
this pull request
Dec 5, 2022
…tricStorage and Meter::Collect (open-telemetry#1666)
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.
Fixes #1663
Changes
Add a lock guard to prevent race conditions arising due to
These operations should ensure that sync/sync storage structures and callback registry are atomically updated.
Also added unit-test to stress meter using multiple threads.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes