]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/mgr: s/tick/report/
authorKefu Chai <kchai@redhat.com>
Tue, 10 Mar 2020 10:37:58 +0000 (18:37 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 10 Mar 2020 13:13:47 +0000 (21:13 +0800)
prepare for the change to reconnect right when handling connection reset

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

index 60fbfdf683629ee5977895011619e67328963650..3b33c176b6a3dbbfc88d74c5750e08dbac4c0536 100644 (file)
@@ -26,7 +26,7 @@ Client::Client(crimson::net::Messenger& msgr,
                  WithStats& with_stats)
   : msgr{msgr},
     with_stats{with_stats},
-    tick_timer{[this] {tick();}}
+    report_timer{[this] {report();}}
 {}
 
 seastar::future<> Client::start()
@@ -62,7 +62,7 @@ seastar::future<> Client::ms_handle_reset(crimson::net::ConnectionRef c)
 {
   if (conn == c) {
     conn = nullptr;
-    tick_timer.cancel();
+    report_timer.cancel();
   }
   return seastar::now();
 }
@@ -104,20 +104,20 @@ seastar::future<> Client::handle_mgr_conf(crimson::net::Connection* conn,
 {
   logger().info("{} {}", __func__, *m);
 
-  auto tick_period = std::chrono::seconds{m->stats_period};
-  if (tick_period.count()) {
-    if (tick_timer.armed()) {
-      tick_timer.rearm(tick_timer.get_timeout(), tick_period);
+  auto report_period = std::chrono::seconds{m->stats_period};
+  if (report_period.count()) {
+    if (report_timer.armed()) {
+      report_timer.rearm(report_timer.get_timeout(), report_period);
     } else {
-      tick_timer.arm_periodic(tick_period);
+      report_timer.arm_periodic(report_period);
     }
   } else {
-    tick_timer.cancel();
+    report_timer.cancel();
   }
   return seastar::now();
 }
 
-void Client::tick()
+void Client::report()
 {
   (void) seastar::with_gate(gate, [this] {
     if (conn) {
index 0332c59d57b42d5d28d1ddf71d2c849d8ed4b38d..0a7048eed3ed3e34ae1039b854e83c3f44782a47 100644 (file)
@@ -45,14 +45,14 @@ private:
   seastar::future<> handle_mgr_conf(crimson::net::Connection* conn,
                                    Ref<MMgrConfigure> m);
   seastar::future<> reconnect();
-  void tick();
+  void report();
 
 private:
   MgrMap mgrmap;
   crimson::net::Messenger& msgr;
   WithStats& with_stats;
   crimson::net::ConnectionRef conn;
-  seastar::timer<seastar::lowres_clock> tick_timer;
+  seastar::timer<seastar::lowres_clock> report_timer;
   seastar::gate gate;
 };