From d78cbb3ebda0c00e3ebd47aa1b3b45c16753ba80 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Tue, 17 Mar 2020 15:14:06 +0800 Subject: [PATCH] crimson/net: add critical info logs to track and debug racing Signed-off-by: Yingxin Cheng --- src/crimson/net/Protocol.cc | 4 ++++ src/crimson/net/SocketMessenger.cc | 1 + 2 files changed, 5 insertions(+) diff --git a/src/crimson/net/Protocol.cc b/src/crimson/net/Protocol.cc index 7eb952609ed0..3d01f26e50d4 100644 --- a/src/crimson/net/Protocol.cc +++ b/src/crimson/net/Protocol.cc @@ -48,6 +48,10 @@ void Protocol::close(bool dispatch_reset, return; } + logger().info("{} closing: reset {}, replace {}", conn, + dispatch_reset ? "yes" : "no", + f_accept_new ? "yes" : "no"); + // unregister_conn() drops a reference, so hold another until completion auto cleanup = [conn_ref = conn.shared_from_this(), this] { logger().debug("{} closed!", conn); diff --git a/src/crimson/net/SocketMessenger.cc b/src/crimson/net/SocketMessenger.cc index 2817602cac7d..c11e2b32753e 100644 --- a/src/crimson/net/SocketMessenger.cc +++ b/src/crimson/net/SocketMessenger.cc @@ -141,6 +141,7 @@ SocketMessenger::connect(const entity_addr_t& peer_addr, const entity_type_t& pe ceph_assert(peer_addr.get_port() > 0); if (auto found = lookup_conn(peer_addr); found) { + logger().info("{} connect to existing", *found); return found->shared_from_this(); } SocketConnectionRef conn = seastar::make_shared( -- 2.47.3