diff --git a/be/src/util/metrics.cpp b/be/src/util/metrics.cpp index 1e92a360a4d919..b09e1989509043 100644 --- a/be/src/util/metrics.cpp +++ b/be/src/util/metrics.cpp @@ -271,7 +271,9 @@ void MetricEntity::trigger_hook_unlocked(bool force) const { } } -MetricRegistry::~MetricRegistry() {} +MetricRegistry::~MetricRegistry() { + LOG_INFO("MetricRegistry is destroyed."); +} std::shared_ptr MetricRegistry::register_entity(const std::string& name, const Labels& labels, @@ -323,12 +325,12 @@ void MetricRegistry::trigger_all_hooks(bool force) const { std::string MetricRegistry::to_prometheus(bool with_tablet_metrics) const { // Reorder by MetricPrototype EntityMetricsByType entity_metrics_by_types; - std::lock_guard l(_lock); + std::lock_guard l1(_lock); for (const auto& entity : _entities) { if (entity.first->_type == MetricEntityType::kTablet && !with_tablet_metrics) { continue; } - std::lock_guard l(entity.first->_lock); + std::lock_guard l2(entity.first->_lock); entity.first->trigger_hook_unlocked(false); for (const auto& metric : entity.first->_metrics) { std::pair new_elem = diff --git a/be/src/util/threadpool.cpp b/be/src/util/threadpool.cpp index 0025963ad2dede..b34f1b1c5c28aa 100644 --- a/be/src/util/threadpool.cpp +++ b/be/src/util/threadpool.cpp @@ -272,7 +272,6 @@ ThreadPool::~ThreadPool() { // There should only be one live token: the one used in tokenless submission. CHECK_EQ(1, _tokens.size()) << strings::Substitute( "Threadpool $0 destroyed with $1 allocated tokens", _name, _tokens.size()); - shutdown(); } Status ThreadPool::init() {