]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net/ProtocolV1: close connection when replaced
authorSamuel Just <sjust@redhat.com>
Thu, 30 May 2019 00:32:14 +0000 (17:32 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 31 May 2019 21:05:45 +0000 (14:05 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/net/ProtocolV1.cc

index 668ad7c5c51715104a7ce15186ca26c4bd3b57b8..7e8f7e18c24a6357048accef3c2eeab7b1b3b22f 100644 (file)
@@ -455,7 +455,6 @@ seastar::future<stop_t> 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<stop_t> 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));
 }