From 3e16fd815ca10ee87e49b618e4379fe5eac81c2d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 12 Feb 2019 21:40:15 +0800 Subject: [PATCH] crimson/osd: set_callback in ctor there is no need to do so in `start()`. Signed-off-by: Kefu Chai --- src/crimson/osd/osd.cc | 6 +++--- src/crimson/osd/osd.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 48fb64e2f84..9055f325f6b 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -36,7 +36,9 @@ using ceph::os::CyanStore; OSD::OSD(int id, uint32_t nonce) : whoami{id}, - nonce{nonce} + nonce{nonce}, + beacon_timer{[this] { send_beacon(); }}, + heartbeat_timer{[this] { update_heartbeat_peers(); }} { osdmaps[0] = boost::make_local_shared(); } @@ -174,8 +176,6 @@ seastar::future<> OSD::start() return heartbeat->start(public_msgr->get_myaddrs(), cluster_msgr->get_myaddrs()); }).then([this] { - beacon_timer.set_callback([this] { send_beacon(); }); - heartbeat_timer.set_callback([this] { update_heartbeat_peers(); }); return start_boot(); }); } diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index 00fc03f371b..6052c8406e3 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -40,9 +40,9 @@ template using Ref = boost::intrusive_ptr; class OSD : public ceph::net::Dispatcher, private OSDMapService { seastar::gate gate; - seastar::timer beacon_timer; const int whoami; const uint32_t nonce; + seastar::timer beacon_timer; // talk with osd ceph::net::Messenger* cluster_msgr = nullptr; // talk with client/mon/mgr -- 2.39.5