]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: mark down heartbeat connections on shutdown
authorSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 17:42:34 +0000 (12:42 -0500)
committerSage Weil <sage@redhat.com>
Mon, 5 Aug 2019 18:53:25 +0000 (13:53 -0500)
This ensures that heartbeat_reset() gets call and we clean up the
ref loop between the Connections and Sessions.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 200021fa3a8450f714ec6c0f36d865e5a7a2f49d..4de931f40161086df5767d906bf7bd6c1484711c 100644 (file)
@@ -3432,9 +3432,15 @@ int OSD::shutdown()
     std::lock_guard l{heartbeat_lock};
     heartbeat_stop = true;
     heartbeat_cond.notify_all();
+    heartbeat_peers.clear();
   }
   heartbeat_thread.join();
 
+  hb_back_server_messenger->mark_down_all();
+  hb_front_server_messenger->mark_down_all();
+  hb_front_client_messenger->mark_down_all();
+  hb_back_client_messenger->mark_down_all();
+
   osd_op_tp.drain();
   osd_op_tp.stop();
   dout(10) << "op sharded tp stopped" << dendl;
@@ -4927,6 +4933,7 @@ bool OSD::heartbeat_reset(Connection *con)
 {
   std::lock_guard l(heartbeat_lock);
   auto s = con->get_priv();
+  dout(20) << __func__ << " con " << con << " s " << s.get() << dendl;
   con->set_priv(nullptr);
   if (s) {
     if (is_stopping()) {