From e69bbada0b9ed925cd5ff0182071a44f7abe50e4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Dec 2019 14:34:31 -0600 Subject: [PATCH] mds/MDSDaemon: fix asok 'exit' and 'respawn' commands Signed-off-by: Sage Weil --- src/mds/MDSDaemon.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 946177e426ad..4959210dec1c 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -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"; -- 2.47.3