From f3aded93704e172fc3a7184df0f2cf81f568c4bb Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Mon, 1 Feb 2021 00:10:57 +0800 Subject: [PATCH] [Bug] System metric init failed cause be start failed (#5262) System metric init failed cause be start failed --- be/src/common/daemon.cpp | 5 +++++ be/src/util/doris_metrics.cpp | 1 + be/src/util/doris_metrics.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp index 9e55317ce4..99977d0c4a 100644 --- a/be/src/common/daemon.cpp +++ b/be/src/common/daemon.cpp @@ -289,6 +289,11 @@ void Daemon::start() { CHECK(st.ok()) << st.to_string(); if (config::enable_metric_calculator) { + CHECK(DorisMetrics::instance()->is_inited()) + << "enable metric calculator failed, maybe you set enable_system_metrics to false " + << " or there may be some hardware error which causes metric init failed, please check log first;" + << " you can set enable_metric_calculator = false to quickly recover "; + st = Thread::create( "Daemon", "calculate_metrics_thread", [this]() { this->calculate_metrics_thread(); }, &_calculate_metrics_thread); diff --git a/be/src/util/doris_metrics.cpp b/be/src/util/doris_metrics.cpp index 6d500dd339..4d267dafdc 100644 --- a/be/src/util/doris_metrics.cpp +++ b/be/src/util/doris_metrics.cpp @@ -281,6 +281,7 @@ void DorisMetrics::initialize(bool init_system_metrics, const std::set _system_metrics; std::shared_ptr _server_metric_entity; + + bool _is_inited = false; }; }; // namespace doris