From c5fec5f7bd2b14d53b7d7ea996a2ee6d7826464d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 29 May 2019 17:32:14 -0700 Subject: [PATCH] crimson/net/ProtocolV1: close connection when replaced Signed-off-by: Samuel Just --- src/crimson/net/ProtocolV1.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crimson/net/ProtocolV1.cc b/src/crimson/net/ProtocolV1.cc index 668ad7c5c51..7e8f7e18c24 100644 --- a/src/crimson/net/ProtocolV1.cc +++ b/src/crimson/net/ProtocolV1.cc @@ -455,7 +455,6 @@ seastar::future ProtocolV1::replace_existing( } else { reply_tag = CEPH_MSGR_TAG_READY; } - messenger.unregister_conn(existing); if (!existing->is_lossy()) { // reset the in_seq if this is a hard reset from peer, // otherwise we respect our original connection's value @@ -464,6 +463,11 @@ seastar::future ProtocolV1::replace_existing( existing->requeue_sent(); std::tie(conn.out_seq, conn.out_q) = existing->get_out_queue(); } + seastar::do_with( + std::move(existing), + [](auto existing) { + return existing->close(); + }); return send_connect_reply_ready(reply_tag, std::move(authorizer_reply)); } -- 2.39.5