-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Change metric.Producer to be an Option on Reader #4346
Change metric.Producer to be an Option on Reader #4346
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4346 +/- ##
=======================================
- Coverage 78.8% 78.8% -0.1%
=======================================
Files 253 253
Lines 20644 20630 -14
=======================================
- Hits 16281 16267 -14
Misses 4014 4014
Partials 349 349
|
4cae38d
to
1740d9c
Compare
@MrAlias The register pattern came from your comment here: open-telemetry/opentelemetry-specification#2722 (comment) |
3f19cae
to
60473b7
Compare
I think there is a potential race condition (which existed before) when The reader is initialized with some
The same problem could occur if one manually invokes How to fix it? I am not sure 😉 My initial thought is to change My second idea is to remove This comment is not blocking this PR as this PR does not introduce this problem. I just noticed it when reviewing. |
60473b7
to
56a5ef9
Compare
I'm surprised this isn't caught by our concurrency tests... |
I "fixed" our concurrency tests to expose the race condition. |
7b2dbb7
to
6b9f2ed
Compare
I believe switching back to atomic.Value to hold producers fixed the race condition. |
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.
🥇
👍 PS. I have not noticed that it was |
Updates the MetricProducer implementation to comply with open-telemetry/opentelemetry-specification#3613