From: Kefu Chai Date: Sun, 16 Feb 2020 01:00:47 +0000 (+0800) Subject: crimson/osd: refactor OSD::stop_asok_admin() X-Git-Tag: v15.1.1~398^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2887fccf2f282700fa542a8535767de53a5b44ae;p=ceph.git crimson/osd: refactor OSD::stop_asok_admin() the comment does not apply anymore, since `admin` and `asok` are created in the constructor. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index dd877c80f582..18b6fa62a866 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -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(); }); }