From: Yingxin Cheng Date: Fri, 27 Nov 2020 05:38:12 +0000 (+0800) Subject: crimson/net: link the throttling future in both v1 and v2 X-Git-Tag: v16.1.0~416^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67c87a3573182dc4112890fa4c76d02bdf9c8561;p=ceph.git crimson/net: link the throttling future in both v1 and v2 The current implementations are correct and will not link the throttleing future with unrelated futures. Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/ProtocolV1.cc b/src/crimson/net/ProtocolV1.cc index 1a841a542f58..9b6c59f89232 100644 --- a/src/crimson/net/ProtocolV1.cc +++ b/src/crimson/net/ProtocolV1.cc @@ -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)); }); } diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 750f458bd9df..de1d6f55f810 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -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)); }); }