mgr: _exit(0) from signal handler even if we are standby

In 3d360b97ed 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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-11-15 17:10:41 -06:00
parent fc2bb6ed47
commit ce6013cd32

View File

@ -222,9 +222,7 @@ std::map<std::string, std::string> 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()