]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSDaemon: fix asok 'exit' and 'respawn' commands 32251/head
authorSage Weil <sage@redhat.com>
Fri, 13 Dec 2019 20:34:31 +0000 (14:34 -0600)
committerSage Weil <sage@redhat.com>
Sat, 14 Dec 2019 02:16:52 +0000 (20:16 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSDaemon.cc

index 946177e426ad6b248320a5816c2be7985b646bbf..4959210dec1c3ebc790e1fff89c57de09999f93f 100644 (file)
@@ -148,8 +148,10 @@ void MDSDaemon::asok_command(
                    // Wait a little to improve chances of caller getting
                    // our response before seeing us disappear from mdsmap
                    sleep(1);
+                   std::lock_guard l(mds_lock);
                    suicide();
                  });
+    t.detach();
   } else if (command == "respawn") {
     outbl.append("Respawning...\n");
     r = 0;
@@ -157,8 +159,10 @@ void MDSDaemon::asok_command(
                    // Wait a little to improve chances of caller getting
                    // our response before seeing us disappear from mdsmap
                    sleep(1);
+                   std::lock_guard l(mds_lock);
                    respawn();
                  });
+    t.detach();
   } else if (command == "heap") {
     if (!ceph_using_tcmalloc()) {
       ss << "not using tcmalloc";