mirror of
https://github.com/wassname/ray.git
synced 2026-07-10 11:32:47 +08:00
[Stats] fix stats shutdown crash if opencensus exporter not initialized (#9727)
This commit is contained in:
@@ -103,6 +103,10 @@ static inline void Init(const TagsType &global_tags, const int metrics_agent_por
|
||||
static inline void Shutdown() {
|
||||
// TODO(sang): Harvest thread is not currently cleaned up.
|
||||
absl::MutexLock lock(&stats_mutex);
|
||||
if (!StatsConfig::instance().IsInitialized()) {
|
||||
// Return if stats had never been initialized.
|
||||
return;
|
||||
}
|
||||
metrics_io_service_pool->Stop();
|
||||
opencensus::stats::StatsExporter::Shutdown();
|
||||
metrics_io_service_pool = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user