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>
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);