-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1663 Threading issue between Meter::RegisterSyncMetricStorage and Meter::Collect #1666
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
|
This is ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
…into fix-race-meter
Have added logic to make threads to join before finishing the unit test. Hope it suffices. |
…tricStorage and Meter::Collect (open-telemetry#1666)
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.md
updated for non-trivial changes