From f68ad16e86f5abaedc9261aa09250d75fe372e31 Mon Sep 17 00:00:00 2001 From: John Spray Date: Sun, 5 Mar 2017 10:38:36 -0500 Subject: [PATCH] mon: don't enqueue periodic digest if one is already waiting This was causing mons to send far more digest messages than should have been sent. Could have been responsible for reports of very high CPU consumption on the mgr daemon. Fixes: http://tracker.ceph.com/issues/18994 Signed-off-by: John Spray --- src/mon/MgrMonitor.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index 5d6bbb931a6a..7079db17b5b3 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -263,7 +263,9 @@ void MgrMonitor::check_sub(Subscription *sub) } } else { assert(sub->type == "mgrdigest"); - send_digests(); + if (digest_callback == nullptr) { + send_digests(); + } } } @@ -536,7 +538,9 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op) void MgrMonitor::init() { - send_digests(); // To get it to schedule its own event + if (digest_callback == nullptr) { + send_digests(); // To get it to schedule its own event + } } void MgrMonitor::on_shutdown() -- 2.47.3