Change metric.Producer to be an Option on Reader#4346
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
🚀 New features to boost your workflow:
|
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. |
👍 PS. I have not noticed that it was |
Updates the MetricProducer implementation to comply with open-telemetry/opentelemetry-specification#3613