From 642f68159e3add230b52410f3069b81da5378f4b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 27 Nov 2019 17:26:46 +0800 Subject: [PATCH] crimson: stop osd before stopping messengers so we can drain all pending tasks referencing messenger before destroying it, otherwise they will be using a already-stopped messenger when they are still alive. Signed-off-by: Kefu Chai --- src/crimson/osd/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index e8584bdbe345..8d9152debd4a 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -173,9 +173,6 @@ int main(int argc, char* argv[]) reference_wrapper(client_msgr.local()), reference_wrapper(hb_front_msgr.local()), reference_wrapper(hb_back_msgr.local())).get(); - seastar::engine().at_exit([&] { - return osd.stop(); - }); seastar::engine().at_exit([&] { return seastar::when_all_succeed(cluster_msgr.stop(), client_msgr.stop(), @@ -194,6 +191,9 @@ int main(int argc, char* argv[]) local_conf().get_val("osd_uuid"), local_conf().get_val("fsid")).get(); } + seastar::engine().at_exit([&] { + return osd.stop(); + }); if (config.count("mkkey") || config.count("mkfs")) { seastar::engine().exit(0); } else { -- 2.47.3