auto since = std::chrono::duration<double>(now-last_send).count();
auto interval = beacon_interval;
if (since >= interval*.90) {
- _send();
+ if (!_send()) {
+ interval = 0.5; /* 500ms */
+ }
} else {
interval -= since;
}
/**
* Call periodically, or when you have updated the desired state
*/
-void Beacon::_send()
+bool Beacon::_send()
{
auto now = clock::now();
auto since = std::chrono::duration<double>(now-last_acked_stamp).count();
/* If anything isn't progressing, let avoid sending a beacon so that
* the MDS will consider us laggy */
dout(0) << "Skipping beacon heartbeat to monitors (last acked " << since << "s ago); MDS internal heartbeat is not healthy!" << dendl;
- return;
+ return false;
}
++last_seq;
}
monc->send_mon_message(beacon.detach());
last_send = now;
+ return true;
}
/**