]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: use "is_connected" check when scheduling tick 36634/head
authorMykola Golub <mgolub@suse.com>
Thu, 30 Jul 2020 05:59:57 +0000 (06:59 +0100)
committerNathan Cutler <ncutler@suse.com>
Fri, 14 Aug 2020 09:58:15 +0000 (11:58 +0200)
When schedule_tick is called for the first time (in init) we are
still not in hunting mode so mon_client_ping_interval and
mon_client_log_interval were used to schedule the tick.

Fixes: https://tracker.ceph.com/issues/46445
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit d86b389a51e870c1aa5182a93095f5efb12e41e4)

Conflicts:
src/mon/MonClient.cc

src/mon/MonClient.cc

index 6cb4aec1304d9deac231f9313cd47a31047260fb..ab24689a1cd642d26af968f37fb80e4555f4f98b 100644 (file)
@@ -863,11 +863,13 @@ void MonClient::_un_backoff()
 void MonClient::schedule_tick()
 {
   auto do_tick = make_lambda_context([this]() { tick(); });
-  if (_hunting()) {
+  if (!is_connected()) {
+    // start another round of hunting
     const auto hunt_interval = (cct->_conf->mon_client_hunt_interval *
                                reopen_interval_multiplier);
     timer.add_event_after(hunt_interval, do_tick);
   } else {
+    // keep in touch
     timer.add_event_after(cct->_conf->mon_client_ping_interval, do_tick);
   }
 }