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>
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();
}
}
+bool MDSDaemon::is_clean_shutdown()
+{
+ if (mds_rank) {
+ return mds_rank->is_stopped();
+ } else {
+ return true;
+ }
+}
+
// 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,