From: Kefu Chai Date: Tue, 12 Feb 2019 13:40:15 +0000 (+0800) Subject: crimson/osd: set_callback in ctor X-Git-Tag: v14.1.0~66^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e16fd815ca10ee87e49b618e4379fe5eac81c2d;p=ceph.git crimson/osd: set_callback in ctor there is no need to do so in `start()`. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 48fb64e2f848b..9055f325f6b78 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 00fc03f371bee..6052c8406e34d 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