so osd is able to shut itself down per monitor's request.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
local_conf().get_config_values()).get();
crimson::osd::OSD osd(
- whoami, nonce, std::ref(*store), cluster_msgr, client_msgr,
+ whoami, nonce, std::ref(should_stop.abort_source()),
+ std::ref(*store), cluster_msgr, client_msgr,
hb_front_msgr, hb_back_msgr);
if (config.count("mkkey")) {
namespace crimson::osd {
OSD::OSD(int id, uint32_t nonce,
+ seastar::abort_source& abort_source,
crimson::os::FuturizedStore& store,
crimson::net::MessengerRef cluster_msgr,
crimson::net::MessengerRef public_msgr,
crimson::net::MessengerRef hb_back_msgr)
: whoami{id},
nonce{nonce},
+ abort_source{abort_source},
// do this in background
beacon_timer{[this] { (void)send_beacon(); }},
cluster_msgr{cluster_msgr},
seastar::future<> OSD::shutdown()
{
- // TODO
+ logger().info("shutting down per osdmap");
+ abort_source.request_abort();
return seastar::now();
}
#pragma once
+#include <seastar/core/abort_source.hh>
#include <seastar/core/future.hh>
#include <seastar/core/shared_future.hh>
#include <seastar/core/gate.hh>
private crimson::mgr::WithStats {
const int whoami;
const uint32_t nonce;
+ seastar::abort_source& abort_source;
seastar::timer<seastar::lowres_clock> beacon_timer;
// talk with osd
crimson::net::MessengerRef cluster_msgr;
public:
OSD(int id, uint32_t nonce,
+ seastar::abort_source& abort_source,
crimson::os::FuturizedStore& store,
crimson::net::MessengerRef cluster_msgr,
crimson::net::MessengerRef client_msgr,