From: Sage Weil Date: Thu, 18 Jul 2013 21:44:17 +0000 (-0700) Subject: mon: break con <-> session ref cycle in mon even if shutting down X-Git-Tag: v0.67-rc1~16^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30de04066d874921b7d721bfcb0f363df8a735f1;p=ceph.git mon: break con <-> session ref cycle in mon even if shutting down If we get a reset during shutdown, we should still break the cycle to avoid tripping the valgrind leak detection. Note that we are touching no internal Monitor state here and the locking has not changed. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 9ae3e93a111b..3ff0a6418b23 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3242,9 +3242,6 @@ bool Monitor::ms_handle_reset(Connection *con) { dout(10) << "ms_handle_reset " << con << " " << con->get_peer_addr() << dendl; - if (is_shutdown()) - return false; - // ignore lossless monitor sessions if (con->get_peer_type() == CEPH_ENTITY_TYPE_MON) return false; @@ -3253,6 +3250,12 @@ bool Monitor::ms_handle_reset(Connection *con) if (!s) return false; + // break any con <-> session ref cycle + s->con->set_priv(NULL); + + if (is_shutdown()) + return false; + Mutex::Locker l(lock); dout(10) << "reset/close on session " << s->inst << dendl;