]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: allow REPLACING state wait for protocol exit
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 8 Aug 2019 08:17:47 +0000 (16:17 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Mon, 12 Aug 2019 09:22:23 +0000 (17:22 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV2.cc
src/crimson/net/ProtocolV2.h

index 76e0f150889445ad60e8e0e04f26f1e43fa8e545..79023d32838e8734401d464bb95246d8d091e29d 100644 (file)
@@ -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) {
index 3bd31af724896f08b43343b0ad79655822434ee8..bce428c6297eb931436cff1236b4ea563ee8d17f 100644 (file)
@@ -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;