]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: discard and add note to discardable futures
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 11 Sep 2019 06:24:48 +0000 (14:24 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 18 Sep 2019 04:32:31 +0000 (12:32 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/SocketMessenger.cc
src/test/crimson/perf_crimson_msgr.cc
src/test/crimson/test_messenger.cc

index 8b75d46e3994de200b49d50361784f6961e5243f..edc47378447a426a7571c7f42cc1f9f2dacc6243 100644 (file)
@@ -142,7 +142,8 @@ seastar::future<> SocketMessenger::shutdown()
 
 void SocketMessenger::do_bind(const entity_addrvec_t& addrs)
 {
-  Messenger::set_myaddrs(addrs);
+  // safe to discard an immediate ready future
+  (void) Messenger::set_myaddrs(addrs);
 
   // TODO: v2: listen on multiple addresses
   seastar::socket_address address(addrs.front().in4_addr());
@@ -162,7 +163,8 @@ seastar::future<> SocketMessenger::do_start(Dispatcher *disp)
     ceph_assert(get_myaddr().is_legacy() || get_myaddr().is_msgr2());
     ceph_assert(get_myaddr().get_port() > 0);
 
-    seastar::keep_doing([this] {
+    // forwarded to accepting_complete
+    (void) seastar::keep_doing([this] {
         return Socket::accept(*listener)
           .then([this] (SocketFRef socket,
                         entity_addr_t peer_addr) {
index f97787f4760d66401884e9daf36d720ac58153b9..d44d1f30462d852cb6c52bbdbd34dafdf13ad4c9 100644 (file)
@@ -601,7 +601,8 @@ static seastar::future<> run(
         ceph_assert(seastar::engine().cpu_id() == sid);
         ceph_assert(sent_count == 0);
         conn_stats.start_time = mono_clock::now();
-        seastar::do_until(
+        // forwarded to stopped_send_promise
+        (void) seastar::do_until(
           [this] { return stop_send; },
           [this, conn] {
             sent_count += 1;
index 82d3edb6ae23735b89d6697c575491eb1e898294..d257bea76c7d04bd23efc59b3b87cb8237be5a7c 100644 (file)
@@ -520,7 +520,8 @@ seastar::future<> test_preemptive_shutdown(bool v2) {
       seastar::future<> send_pings(const entity_addr_t& addr) {
         return msgr->connect(addr, entity_name_t::TYPE_OSD
         ).then([this](ceph::net::ConnectionXRef conn) {
-          seastar::do_until(
+          // forwarded to stopped_send_promise
+          (void) seastar::do_until(
             [this] { return stop_send; },
             [this, conn = &**conn] {
               return conn->send(make_message<MPing>()).then([] {
@@ -1529,7 +1530,8 @@ class FailoverTestPeer : public Dispatcher {
       auto cmd = static_cast<cmd_t>(m_cmd->cmd[0][0]);
       if (cmd == cmd_t::shutdown) {
         logger().info("CmdSrv shutdown...");
-        cmd_msgr.shutdown();
+        // forwarded to FailoverTestPeer::wait()
+        (void) cmd_msgr.shutdown();
         return seastar::now();
       }
       return handle_cmd(cmd, m_cmd).then([c] {