]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: track closing connections for v1
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 07:51:01 +0000 (15:51 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 07:51:01 +0000 (15:51 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV1.cc
src/crimson/net/ProtocolV1.h

index bf7cd633880549b2ace2db9d8a8b9c4e569fb34e..5d04422da755cf66e378f0e04f0352a0b3d3d932 100644 (file)
@@ -952,6 +952,9 @@ void ProtocolV1::trigger_close()
 {
   logger().trace("{} trigger closing, was {}",
                  conn, static_cast<int>(state));
+  messenger.closing_conn(
+      seastar::static_pointer_cast<SocketConnection>(
+        conn.shared_from_this()));
 
   if (state == state_t::accepting) {
     messenger.unaccept_conn(seastar::static_pointer_cast<SocketConnection>(
@@ -971,6 +974,13 @@ void ProtocolV1::trigger_close()
   state = state_t::closing;
 }
 
+void ProtocolV1::on_closed()
+{
+  messenger.closed_conn(
+      seastar::static_pointer_cast<SocketConnection>(
+        conn.shared_from_this()));
+}
+
 seastar::future<> ProtocolV1::fault()
 {
   if (conn.policy.lossy) {
index c71af598bcfc52c30b6942e6f6e77932466482dc..ed6df895415fff08d5ac59c126d027d52015349b 100644 (file)
@@ -18,6 +18,7 @@ class ProtocolV1 final : public Protocol {
   ~ProtocolV1() override;
   void print(std::ostream&) const final;
  private:
+  void on_closed() override;
   bool is_connected() const override;
 
   void start_connect(const entity_addr_t& peer_addr,