]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net: assert connection gate is not unexpectedly closed
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 07:45:52 +0000 (15:45 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 07:45:52 +0000 (15:45 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/Protocol.cc
src/crimson/net/ProtocolV1.cc
src/crimson/net/ProtocolV2.cc

index 6973aa5df5bc670681fa83ccb99f7cb15c8f6255..4c9c1846ce9d81a36792649ee52b391dc6194b72 100644 (file)
@@ -70,6 +70,7 @@ void Protocol::close(bool dispatch_reset,
     socket->shutdown();
   }
   set_write_state(write_state_t::drop);
+  assert(!gate.is_closed());
   auto gate_closed = gate.close();
 
   if (dispatch_reset) {
@@ -306,6 +307,7 @@ void Protocol::write_event()
    case write_state_t::open:
      [[fallthrough]];
    case write_state_t::delay:
+    assert(!gate.is_closed());
     gate.dispatch_in_background("do_write_dispatch_sweep", *this, [this] {
       return do_write_dispatch_sweep();
     });
index 34fb14573e217975b959cf96bec60d5d49a30776..bf7cd633880549b2ace2db9d8a8b9c4e569fb34e 100644 (file)
@@ -316,6 +316,7 @@ void ProtocolV1::start_connect(const entity_addr_t& _peer_addr,
   set_write_state(write_state_t::delay);
 
   ceph_assert(!socket);
+  ceph_assert(!gate.is_closed());
   conn.peer_addr = _peer_addr;
   conn.target_addr = _peer_addr;
   conn.set_peer_name(_peer_name);
index 4d7d06d7a3361aef807c3520ca4414a61d9c572b..bf9224b1712a7ddaabfd29ed7e6492d20710bf76 100644 (file)
@@ -164,6 +164,7 @@ void ProtocolV2::start_connect(const entity_addr_t& _peer_addr,
 {
   ceph_assert(state == state_t::NONE);
   ceph_assert(!socket);
+  ceph_assert(!gate.is_closed());
   conn.peer_addr = _peer_addr;
   conn.target_addr = _peer_addr;
   conn.set_peer_name(_peer_name);