]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: reinstate conditional destruction 5212/head
authorJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 07:57:08 +0000 (08:57 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 08:05:09 +0000 (09:05 +0100)
Still got xlist not empty asserts on deletion of MDSRank,
so reinstate the condition that we only delete on
is_stopped().

Additionally, allow deletion in the case that we never had
a rank to begin with.

Signed-off-by: John Spray <john.spray@redhat.com>
src/ceph_mds.cc
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h

index f8d4420c477ab025f2f3c5c33aef4a63f5b1e5c6..91ff002e1edd223e90e3b05d04601a55102c4ef5 100644 (file)
@@ -236,8 +236,12 @@ int main(int argc, const char **argv)
 
   pidfile_remove();
 
-  delete mds;
-  delete msgr;
+  // 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_clean_shutdown()) {
+    delete mds;
+    delete msgr;
+  }
 
   g_ceph_context->put();
 
index 5093f594738f4bbc0d216efe0c2ed11ca7c45410..0ab6473c98f04ed0b711e1246d9952cdeb1461fe 100644 (file)
@@ -1317,3 +1317,12 @@ void MDSDaemon::ms_handle_accept(Connection *con)
   }
 }
 
+bool MDSDaemon::is_clean_shutdown()
+{
+  if (mds_rank) {
+    return mds_rank->is_stopped();
+  } else {
+    return true;
+  }
+}
+
index 3203ec1af5a94cd99c71b748a30742c9df3c4391..ba3f456e9c0720269808ee83e8a8f37e1c9a14ce 100644 (file)
@@ -112,6 +112,14 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
   // start up, shutdown
   int init(MDSMap::DaemonState wanted_state=MDSMap::STATE_BOOT);
 
+  /**
+   * Hint at whether we were shutdown gracefully (i.e. we were only
+   * in standby, or our rank was stopped).  Should be removed once
+   * we handle shutdown properly (e.g. clear out all message queues)
+   * such that deleting xlists doesn't assert.
+   */
+  bool is_clean_shutdown();
+
   // config observer bits
   virtual const char** get_tracked_conf_keys() const;
   virtual void handle_conf_change(const struct md_config_t *conf,