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 <nmordec@ibm.com>
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;
}
ThreadMonitor(CephContext *cct)
: m_cct(cct),
running(false),
- monitoring_interval(m_cct->_conf.get_val<int64_t>("mgr_module_monitor_interval"))
+ monitoring_interval(std::chrono::seconds(m_cct->_conf.get_val<int64_t>("mgr_module_monitor_interval")))
{
m_cct->_conf.add_observer(this);
m_clock_ticks_per_sec = sysconf(_SC_CLK_TCK);