From 16264a5171351bfa35696ba83a771f047d3ca04e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 2 Jan 2019 13:04:14 -0600 Subject: [PATCH] msg/async/Protocol*: unregister con from accept vs mark_down race If we are accepting a connection and it gets marked down while we are working on it, unregister it. Otherwise, we leave teh connection CLOSED and registered and it interferes with the ability to open a new connection. Fixes: http://tracker.ceph.com/issues/37778 Signed-off-by: Sage Weil --- src/msg/async/ProtocolV1.cc | 1 + src/msg/async/ProtocolV2.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index ab4b526105f..0c2627b3378 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -2387,6 +2387,7 @@ CtPtr ProtocolV1::open(ceph_msg_connect_reply &reply, << dendl; ceph_assert(state == CLOSED || state == NONE); ldout(cct, 10) << "accept fault after register" << dendl; + messenger->unregister_conn(connection); connection->inject_delay(); return _fault(); } diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 99b424e6dbc..bfa08fc4038 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -2426,6 +2426,7 @@ CtPtr ProtocolV2::open(ceph_msg_connect_reply &reply, << dendl; ceph_assert(state == CLOSED || state == NONE); ldout(cct, 10) << "accept fault after register" << dendl; + messenger->unregister_conn(connection); connection->inject_delay(); return _fault(); } -- 2.47.3