From: Mykola Golub Date: Thu, 30 Jul 2020 05:59:57 +0000 (+0100) Subject: monclient: use "is_connected" check when scheduling tick X-Git-Tag: v17.0.0~1588^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d86b389a51e870c1aa5182a93095f5efb12e41e4;p=ceph.git monclient: use "is_connected" check when scheduling tick 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 --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index e2e46bc24fa31..de51bc70416c9 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -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);