]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle heartbeat_reset during shutdown 3370/head
authorJohn Spray <john.spray@redhat.com>
Wed, 14 Jan 2015 10:35:53 +0000 (10:35 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 14 Jan 2015 12:00:17 +0000 (12:00 +0000)
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 <john.spray@redhat.com>
src/mds/MDS.cc

index 370c11d64c793f866ccba437a0929fd151424c30..6118fb1b1e786d04f647698610a104f7f9551040 100644 (file)
@@ -2942,7 +2942,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.