From ce6013cd321e92a245c575a9d9ef9a8b032760d6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Nov 2019 17:10:41 -0600 Subject: [PATCH] mgr: _exit(0) from signal handler even if we are standby In 3d360b97ed7dead8e9a5f602cfaf61ab7b41e531 a signal handler was added to shut down modules and associated clients cleanly, but the standby case was left ignoring the signal completely. Fixes: https://tracker.ceph.com/issues/42744 Signed-off-by: Sage Weil --- src/mgr/Mgr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index a10746a2cfb90..8a8b7e9f28a5a 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -222,9 +222,7 @@ std::map Mgr::load_store() void Mgr::handle_signal(int signum) { ceph_assert(signum == SIGINT || signum == SIGTERM); - derr << "*** Got signal " << sig_str(signum) << " ***" << dendl; shutdown(); - _exit(0); // exit with 0 result code, as if we had done an orderly shutdown } // A reference for use by the signal handler @@ -232,9 +230,11 @@ static Mgr *signal_mgr = nullptr; static void handle_mgr_signal(int signum) { + derr << " *** Got signal " << sig_str(signum) << " ***" << dendl; if (signal_mgr) { signal_mgr->handle_signal(signum); } + _exit(0); // exit with 0 result code, as if we had done an orderly shutdown } void Mgr::init() -- 2.39.5