]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: use "is_connected" check when scheduling tick 36065/head
authorMykola Golub <mgolub@suse.com>
Thu, 30 Jul 2020 05:59:57 +0000 (06:59 +0100)
committerMykola Golub <mgolub@suse.com>
Thu, 30 Jul 2020 05:59:57 +0000 (06:59 +0100)
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>
src/mon/MonClient.cc

index e2e46bc24fa316ccbc502c2eb30c58ce1b38ad8e..de51bc70416c9a804c65a76d001110c80e4803f7 100644 (file)
@@ -959,11 +959,13 @@ void MonClient::_un_backoff()
 void MonClient::schedule_tick()
 {
   auto do_tick = make_lambda_context([this](int) { 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(std::min(cct->_conf->mon_client_ping_interval,
                                   cct->_conf->mon_client_log_interval),
                          do_tick);