This avoids bad asserts on suicide, but still lets us find memory leaks
on clean shutdowns.
mds->mds_lock.Lock();
mds->mds_lock.Unlock();
- // done
- delete mds;
+ // only delete if it was a clean shutdown (to aid memory leak
+ // detection, etc.). don't bother if it was a suicide.
+ if (mds->is_stopped())
+ delete mds;
// cd on exit, so that gmon.out (if any) goes into a separate directory for each node.
char s[20];
void MDS::suicide()
{
- dout(1) << "suicide" << dendl;
- state = MDSMap::STATE_STOPPED; // well, maybe failed, but close enough.
+ if (want_state == MDSMap::STATE_STOPPED)
+ state = want_state;
+ else
+ state = CEPH_MDS_STATE_DNE; // whatever.
+
+ dout(1) << "suicide. wanted " << ceph_mds_state_name(want_state)
+ << ", now " << ceph_mds_state_name(state) << dendl;
// stop timers
if (beacon_killer) {