]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/monc: close pending connections when stopping
authorXuehan Xu <xxhdx1985126@163.com>
Mon, 13 Apr 2020 05:42:11 +0000 (13:42 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Fri, 5 Jun 2020 10:44:18 +0000 (18:44 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@163.com>
src/crimson/mon/MonClient.cc

index 6e52b3ba25ee6d8f351131d84a813d24dd846825..a6fc5cc024950bd4392d595b302ba931a1e2e789 100644 (file)
@@ -922,6 +922,9 @@ seastar::future<> Client::stop()
   logger().info("{}", __func__);
   auto fut = gate.close();
   timer.cancel();
+  for (auto& pending_con : pending_conns) {
+    pending_con->close();
+  }
   if (active_con) {
     active_con->close();
   }
@@ -1000,7 +1003,10 @@ seastar::future<> Client::reopen_session(int rank)
       return seastar::make_exception_future(ep);
     });
   }).then([this] {
-    ceph_assert_always(active_con);
+    if (!active_con) {
+      return seastar::make_exception_future(
+         crimson::common::system_shutdown_exception());
+    }
     return active_con->renew_rotating_keyring();
   });
 }