From: Yingxin Cheng Date: Thu, 8 Aug 2019 08:17:47 +0000 (+0800) Subject: crimson/net: allow REPLACING state wait for protocol exit X-Git-Tag: v15.1.0~1910^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dd59586ef0f47c63e13e8afbb77569b8dde5d7ba;p=ceph.git crimson/net: allow REPLACING state wait for protocol exit Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 76e0f1508894..79023d32838e 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -843,7 +843,7 @@ void ProtocolV2::execute_connecting() if (socket) { socket->shutdown(); } - seastar::with_gate(pending_dispatch, [this] { + execution_done = seastar::with_gate(pending_dispatch, [this] { // we don't know my socket_port yet conn.set_ephemeral_port(0, SocketConnection::side_t::none); return messenger.get_global_seq().then([this] (auto gs) { @@ -1683,7 +1683,7 @@ seastar::future<> ProtocolV2::read_message(utime_t throttle_stamp) void ProtocolV2::execute_ready() { trigger_state(state_t::READY, write_state_t::open, false); - seastar::with_gate(pending_dispatch, [this] { + execution_done = seastar::with_gate(pending_dispatch, [this] { return seastar::keep_doing([this] { return read_main_preamble() .then([this] (Tag tag) { diff --git a/src/crimson/net/ProtocolV2.h b/src/crimson/net/ProtocolV2.h index 3bd31af72489..bce428c6297e 100644 --- a/src/crimson/net/ProtocolV2.h +++ b/src/crimson/net/ProtocolV2.h @@ -72,6 +72,8 @@ class ProtocolV2 final : public Protocol { uint64_t peer_global_seq = 0; uint64_t connect_seq = 0; + seastar::future<> execution_done = seastar::now(); + // TODO: Frame related implementations, probably to a separate class. private: bool record_io = false;