]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: _exit(0) from signal handler even if we are standby 31685/head
authorSage Weil <sage@redhat.com>
Fri, 15 Nov 2019 23:10:41 +0000 (17:10 -0600)
committerSage Weil <sage@redhat.com>
Fri, 15 Nov 2019 23:11:45 +0000 (17:11 -0600)
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 <sage@redhat.com>
src/mgr/Mgr.cc

index a10746a2cfb9023502b6a69bbcf9b5216d458f0d..8a8b7e9f28a5a25a3667b56360568ee0c98a0aaa 100644 (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()