]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: link the throttling future in both v1 and v2
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 27 Nov 2020 05:38:12 +0000 (13:38 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Mon, 30 Nov 2020 03:58:22 +0000 (11:58 +0800)
The current implementations are correct and will not link the
throttleing future with unrelated futures.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV1.cc
src/crimson/net/ProtocolV2.cc

index 1a841a542f58a2a1b7e9421b00c47d99c00356b9..9b6c59f8923202e04e1abfe5bfac7356c1f2a2bd 100644 (file)
@@ -871,12 +871,13 @@ seastar::future<> ProtocolV1::read_message()
 
       if (unlikely(!conn.update_rx_seq(msg->get_seq()))) {
         // skip this message
-        return;
+        return seastar::now();
       }
 
       logger().debug("{} <== #{} === {} ({})",
                      conn, msg_ref->get_seq(), *msg_ref, msg_ref->get_type());
-      std::ignore = dispatcher->ms_dispatch(&conn, std::move(msg_ref));
+      // throttle the reading process by the returned future
+      return dispatchers.ms_dispatch(&conn, std::move(msg_ref));
     });
 }
 
index 750f458bd9dfa361ecaf0d61827db1591b18357c..de1d6f55f810c4ddbe65d1903760680e70a791d5 100644 (file)
@@ -1914,7 +1914,7 @@ seastar::future<> ProtocolV2::read_message(utime_t throttle_stamp)
           local_conf()->ms_die_on_old_message) {
         ceph_assert(0 == "old msgs despite reconnect_seq feature");
       }
-      return;
+      return seastar::now();
     } else if (message->get_seq() > cur_seq + 1) {
       logger().error("{} missed message? skipped from seq {} to {}",
                      conn, cur_seq, message->get_seq());
@@ -1932,7 +1932,8 @@ seastar::future<> ProtocolV2::read_message(utime_t throttle_stamp)
 
     // TODO: change MessageRef with seastar::shared_ptr
     auto msg_ref = MessageRef{message, false};
-    std::ignore = dispatcher->ms_dispatch(&conn, std::move(msg_ref));
+    // throttle the reading process by the returned future
+    return dispatchers.ms_dispatch(&conn, std::move(msg_ref));
   });
 }