]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/mon: do not use futurize_invoke 39779/head
authorKefu Chai <kchai@redhat.com>
Tue, 2 Mar 2021 11:03:38 +0000 (19:03 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Mar 2021 11:13:22 +0000 (19:13 +0800)
flatten the call in seastar::futurize_invoke().

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

index 13bb3cf9ff34fe17c81f3b618462fc11233ab29c..0e6df9ae2e6af58ac100f43ba21aa85f663893ed 100644 (file)
@@ -946,14 +946,11 @@ seastar::future<bool> Client::reopen_session(int rank)
       return seastar::now();
     }
     logger().info("connecting to mon.{}", rank);
-    return seastar::futurize_invoke(
-        [peer, this] () -> seastar::future<Connection::auth_result_t> {
-      auto conn = msgr.connect(peer, CEPH_ENTITY_TYPE_MON);
-      auto& mc = pending_conns.emplace_back(
-       std::make_unique<Connection>(auth_registry, conn, &keyring));
-      assert(conn->get_peer_addr().is_msgr2());
-      return mc->authenticate_v2();
-    }).then([peer, this](auto result) {
+    auto conn = msgr.connect(peer, CEPH_ENTITY_TYPE_MON);
+    auto& mc = pending_conns.emplace_back(
+      std::make_unique<Connection>(auth_registry, conn, &keyring));
+    assert(conn->get_peer_addr().is_msgr2());
+    return mc->authenticate_v2().then([peer, this](auto result) {
       if (result == Connection::auth_result_t::success) {
         _finish_auth(peer);
       }
index 70222196f3303cfea696c9d074f27f85cdadf2dd..9ae4d2a79e8f550dabd13414d9a4ee68d05fb7a5 100644 (file)
@@ -171,7 +171,7 @@ private:
   // @param rank, rank of the monitor to be connected, if it is less than 0,
   //              try to connect to all monitors in monmap, until one of them
   //              is connected.
-  // @return true if a connection is established to a monitor
+  // @return true if a connection to monitor is established
   seastar::future<bool> reopen_session(int rank);
   std::vector<unsigned> get_random_mons(unsigned n) const;
   seastar::future<> _add_conn(unsigned rank, uint64_t global_id);