]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: refactor OSD::stop_asok_admin()
authorKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 01:00:47 +0000 (09:00 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 16 Feb 2020 15:59:30 +0000 (23:59 +0800)
the comment does not apply anymore, since `admin` and `asok` are
created in the constructor.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/osd.cc

index dd877c80f5828fe2a72bb9e9466510135518b775..18b6fa62a8666d8c0799c40d6be5696f839efacc 100644 (file)
@@ -414,33 +414,10 @@ seastar::future<> OSD::start_asok_admin()
   });
 }
 
-/*
-  Note: stop_asok_admin() is executed as part of a destruction process,
-  and may occur even before 'start' is complete. We thus take nothing for granted,
-  and all interfaces are checked for existence.
-*/
 seastar::future<> OSD::stop_asok_admin()
 {
-  return ([this] {
-    if (admin) {
-      return admin->unregister_admin_commands();
-    } else {
-      return seastar::make_ready_future<>();
-    }
-  })().then([this] {
-    if (asok) {
-      return asok->stop().then([this]() {
-        asok.release();
-        return seastar::make_ready_future<>();
-      });
-    } else {
-      return seastar::make_ready_future<>();
-    }
-  }).handle_exception([](auto ep) {
-    logger().error("exception on admin-stop: {}", ep);
-    return seastar::make_ready_future<>();
-  }).finally([] {
-    logger().info("OSD::stop_asok_admin(): Admin-sock service destructed");
+  return admin->unregister_admin_commands().then([this] {
+    return asok->stop();
   });
 }