Merge pull request #31685 from liewegas/fix-mgr-shutdown

mgr: _exit(0) from signal handler even if we are standby
This commit is contained in:
Sage Weil 2019-11-18 16:54:27 -06:00 committed by GitHub
commit 1a29371b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,9 +222,7 @@ std::map<std::string, std::string> Mgr::load_store()
void Mgr::handle_signal(int signum) void Mgr::handle_signal(int signum)
{ {
ceph_assert(signum == SIGINT || signum == SIGTERM); ceph_assert(signum == SIGINT || signum == SIGTERM);
derr << "*** Got signal " << sig_str(signum) << " ***" << dendl;
shutdown(); shutdown();
_exit(0); // exit with 0 result code, as if we had done an orderly shutdown
} }
// A reference for use by the signal handler // A reference for use by the signal handler
@ -232,9 +230,11 @@ static Mgr *signal_mgr = nullptr;
static void handle_mgr_signal(int signum) static void handle_mgr_signal(int signum)
{ {
derr << " *** Got signal " << sig_str(signum) << " ***" << dendl;
if (signal_mgr) { if (signal_mgr) {
signal_mgr->handle_signal(signum); signal_mgr->handle_signal(signum);
} }
_exit(0); // exit with 0 result code, as if we had done an orderly shutdown
} }
void Mgr::init() void Mgr::init()