diff options
author | Sage Weil <sage@inktank.com> | 2013-07-18 14:44:17 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-18 15:02:08 -0700 |
commit | 3c81475be2c5614861590653e86eb206a9ac9723 (patch) | |
tree | 0224777c083db1fa60954cc68be03a30e0c1d14d | |
parent | f7d0403f878137d8ccc0ceb5d3c6a2cb002a8c1d (diff) | |
download | ceph-3c81475be2c5614861590653e86eb206a9ac9723.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/mon/Monitor.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 9ae3e93a111..3ff0a6418b2 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; |