From 56c050335227e8d6bfdbf8715f71fc2b16f50783 Mon Sep 17 00:00:00 2001 From: huanwen ren Date: Wed, 20 Mar 2019 23:46:08 +0800 Subject: [PATCH] mds: there is an assertion when calling Beacon::shutdown() 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 (cherry picked from commit 526bbda6f68873a500c78685a7c39a129d8531e5) --- src/mds/Beacon.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index 0cf8e86eb48..1f205512206 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -56,7 +56,8 @@ void Beacon::shutdown() if (!finished) { finished = true; lock.unlock(); - sender.join(); + if (sender.joinable()) + sender.join(); } } -- 2.47.3