From: Yingxin Cheng Date: Tue, 15 Dec 2020 07:45:52 +0000 (+0800) Subject: crimson/net: assert connection gate is not unexpectedly closed X-Git-Tag: v16.1.0~249^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eabd41ac2cce791a57f9ad5e8c5214d8f06d30ff;p=ceph.git crimson/net: assert connection gate is not unexpectedly closed Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/Protocol.cc b/src/crimson/net/Protocol.cc index 6973aa5df5bc..4c9c1846ce9d 100644 --- a/src/crimson/net/Protocol.cc +++ b/src/crimson/net/Protocol.cc @@ -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(); }); diff --git a/src/crimson/net/ProtocolV1.cc b/src/crimson/net/ProtocolV1.cc index 34fb14573e21..bf7cd6338805 100644 --- a/src/crimson/net/ProtocolV1.cc +++ b/src/crimson/net/ProtocolV1.cc @@ -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); diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 4d7d06d7a336..bf9224b1712a 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -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);