There was an error while loading. Please reload this page.
1 parent 48c5637 commit f023c03Copy full SHA for f023c03
1 file changed
opentelemetry-sdk/src/logs/batch_log_processor.rs
@@ -422,10 +422,11 @@ impl BatchLogProcessor {
422
)
423
.with_unit("{log_record}")
424
.with_callback(move |observer| {
425
- // The capacity value is constant; the Weak upgrade is only a
426
- // liveness guard so a dropped processor stops emitting this
427
- // otherwise-unregisterable callback.
428
- if capacity_state.upgrade().is_some() {
+ // The capacity value is constant; this is only a liveness
+ // guard so a dropped processor stops emitting this
+ // otherwise-unregisterable callback. `strong_count()` is
+ // sufficient since the callback never reads the state.
429
+ if capacity_state.strong_count() > 0 {
430
observer.observe(capacity_value, &capacity_attrs);
431
}
432
})
0 commit comments