From: John Spray Date: Wed, 14 Jan 2015 10:35:53 +0000 (+0000) Subject: mds: handle heartbeat_reset during shutdown X-Git-Tag: v0.87.1~36^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3502%2Fhead;p=ceph.git mds: handle heartbeat_reset during shutdown Because any thread might grab mds_lock and call heartbeat_reset immediately after a call to suicide() completes, this needs to be handled as a special case where we tolerate MDS::hb having already been destroyed. Fixes: #10382 Signed-off-by: John Spray --- diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 229be733a075..fbd695ee2539 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -2383,7 +2383,14 @@ void MDS::set_want_state(MDSMap::DaemonState newstate) */ void MDS::heartbeat_reset() { - assert(hb != NULL); + // Any thread might jump into mds_lock and call us immediately + // after a call to suicide() completes, in which case MDS::hb + // has been freed and we are a no-op. + if (!hb) { + assert(state == CEPH_MDS_STATE_DNE); + return; + } + // NB not enabling suicide grace, because the mon takes care of killing us // (by blacklisting us) when we fail to send beacons, and it's simpler to // only have one way of dying.