]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: don't enqueue periodic digest if one is already waiting
authorJohn Spray <john.spray@redhat.com>
Sun, 5 Mar 2017 15:38:36 +0000 (10:38 -0500)
committerKefu Chai <kchai@redhat.com>
Sun, 30 Apr 2017 02:21:29 +0000 (10:21 +0800)
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 <john.spray@redhat.com>
src/mon/MgrMonitor.cc

index 5d6bbb931a6a7ab21196df1d63dfdae019a3d777..7079db17b5b3321928c13ffa331f8684f0fcc249 100644 (file)
@@ -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()