]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: there is an assertion when calling Beacon::shutdown() 28438/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 20 Mar 2019 15:46:08 +0000 (23:46 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Jun 2019 19:44:46 +0000 (12:44 -0700)
If you run MDSDaemon::init(), an exception occurs that causes MDSDaemon::suicide()--->Beacon::shutdown()--->sender.join();
this problem occurs because sender is just Default-constructed is in Beacon.h(std::thread sender;), there is no call
to Beacon::init() to construct the sender, so the sender has no "joinable"

Fixes: http://tracker.ceph.com/issues/38822
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
(cherry picked from commit 526bbda6f68873a500c78685a7c39a129d8531e5)

src/mds/Beacon.cc

index 0cf8e86eb488f7b6b1796c974fce19c4173c16de..1f20551220681d4bc9dbc8d6e125505a91c620c6 100644 (file)
@@ -56,7 +56,8 @@ void Beacon::shutdown()
   if (!finished) {
     finished = true;
     lock.unlock();
-    sender.join();
+    if (sender.joinable())
+      sender.join();
   }
 }