]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: set_callback in ctor
authorKefu Chai <kchai@redhat.com>
Tue, 12 Feb 2019 13:40:15 +0000 (21:40 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 19 Feb 2019 06:44:03 +0000 (14:44 +0800)
there is no need to do so in `start()`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index 48fb64e2f848bac8212ed41fc666de41309f83e5..9055f325f6b784034e12902ff3e615021b7c648b 100644 (file)
@@ -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<OSDMap>();
 }
@@ -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();
   });
 }
index 00fc03f371bee8cb335f5fddd8a1d202271f6e2c..6052c8406e34dd3075a91df6ec7936980c15e3ac 100644 (file)
@@ -40,9 +40,9 @@ template<typename T> using Ref = boost::intrusive_ptr<T>;
 class OSD : public ceph::net::Dispatcher,
            private OSDMapService {
   seastar::gate gate;
-  seastar::timer<seastar::lowres_clock> beacon_timer;
   const int whoami;
   const uint32_t nonce;
+  seastar::timer<seastar::lowres_clock> beacon_timer;
   // talk with osd
   ceph::net::Messenger* cluster_msgr = nullptr;
   // talk with client/mon/mgr