You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your environment
macOS Ventura, otel-cpp 1.8.3
Steps to reproduce
Run the metrics_simple example
What is the expected behavior?
Example should run without error printouts
What is the actual behavior?
During shutdown, the error MetricReader::Collect invoked while Shutdown in progress! is printed.
Additional context
I found this while implementing metrics in a project I work on, but I then discovered that the metrics_simple example does the same.
I’m using a PeriodicExportingMetricReader. An lldb run confirms that PeriodicExportingMetricReader::OnShutDown is being called, but the log message is emitted during the join() call there on the thread. A backtrace shows that OnShutDown is called from MetricReader::Shutdown(), but that doesn’t happen until after MetricReader::shutdown_ is already set to true. If PeriodicExportingMetricReader::OnShutDown does one more call to Collect during the join (which I wouldn’t be surprised if it does), then it’s going to always output that error.
The text was updated successfully, but these errors were encountered:
The PeriodicExportingMetricReader is supposed to do one last metric collect after shutdown is invoked. But you are right, that last collect would never happen, and will fail with the error. This needs to be fixed.
Describe your environment
macOS Ventura, otel-cpp 1.8.3
Steps to reproduce
Run the
metrics_simple
exampleWhat is the expected behavior?
Example should run without error printouts
What is the actual behavior?
During shutdown, the error
MetricReader::Collect invoked while Shutdown in progress!
is printed.Additional context
I found this while implementing metrics in a project I work on, but I then discovered that the metrics_simple example does the same.
I’m using a
PeriodicExportingMetricReader
. An lldb run confirms thatPeriodicExportingMetricReader::OnShutDown
is being called, but the log message is emitted during thejoin()
call there on the thread. A backtrace shows thatOnShutDown
is called fromMetricReader::Shutdown()
, but that doesn’t happen until afterMetricReader::shutdown_
is already set to true. IfPeriodicExportingMetricReader::OnShutDown
does one more call toCollect
during the join (which I wouldn’t be surprised if it does), then it’s going to always output that error.The text was updated successfully, but these errors were encountered: