#include <boost/range/numeric.hpp>
#include <fmt/format.h>
#include <fmt/ostream.h>
-#include <seastar/core/sleep.hh>
#include "messages/MOSDOp.h"
#include "messages/MOSDOpReply.h"
void PG::queue_check_readable(epoch_t last_peering_reset, ceph::timespan delay)
{
// handle the peering event in the background
- std::ignore = seastar::sleep(delay).then([last_peering_reset, this] {
+ check_readable_timer.cancel();
+ check_readable_timer.set_callback([last_peering_reset, this] {
shard_services.start_operation<LocalPeeringEvent>(
this,
shard_services,
last_peering_reset,
PeeringState::CheckReadable{});
});
+ check_readable_timer.arm(
+ std::chrono::duration_cast<seastar::lowres_clock::duration>(delay));
}
void PG::recheck_readable()
void PG::schedule_renew_lease(epoch_t last_peering_reset, ceph::timespan delay)
{
// handle the peering event in the background
- std::ignore = seastar::sleep(delay).then([last_peering_reset, this] {
+ renew_lease_timer.cancel();
+ renew_lease_timer.set_callback([last_peering_reset, this] {
shard_services.start_operation<LocalPeeringEvent>(
this,
shard_services,
last_peering_reset,
RenewLease{});
});
+ renew_lease_timer.arm(
+ std::chrono::duration_cast<seastar::lowres_clock::duration>(delay));
}