From: Nitzan Mordechai Date: Wed, 27 May 2026 11:48:14 +0000 (+0000) Subject: mgr/ThreadMonitor: monitor interval running in seconds and not nanoseconds X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F69125%2Fhead;p=ceph.git mgr/ThreadMonitor: monitor interval running in seconds and not nanoseconds The ctor accidently use the mgr_module_monitor_interval as nanoseconds we need to use it as seconds. Also, prevent high cpu loop in case read_process_statm failed during while loop Fixes: https://tracker.ceph.com/issues/76938 Signed-off-by: Nitzan Mordechai --- diff --git a/src/mgr/ThreadMonitor.cc b/src/mgr/ThreadMonitor.cc index d26a747ed6e..46f86f6e894 100644 --- a/src/mgr/ThreadMonitor.cc +++ b/src/mgr/ThreadMonitor.cc @@ -88,6 +88,7 @@ void ThreadMonitor::monitoring_loop() { long long process_rss_pages = 0; if (!read_process_statm(process_rss_pages)) { derr << "Failed to read process memory info from /proc/self/statm." << dendl; + std::this_thread::sleep_for(monitoring_interval); continue; } diff --git a/src/mgr/ThreadMonitor.h b/src/mgr/ThreadMonitor.h index 60a839ae965..fe09fd73fd0 100644 --- a/src/mgr/ThreadMonitor.h +++ b/src/mgr/ThreadMonitor.h @@ -21,7 +21,7 @@ public: ThreadMonitor(CephContext *cct) : m_cct(cct), running(false), - monitoring_interval(m_cct->_conf.get_val("mgr_module_monitor_interval")) + monitoring_interval(std::chrono::seconds(m_cct->_conf.get_val("mgr_module_monitor_interval"))) { m_cct->_conf.add_observer(this); m_clock_ticks_per_sec = sysconf(_SC_CLK_TCK);