summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-18 14:44:17 -0700
committerGreg Farnum <greg@inktank.com>2013-07-19 13:21:48 -0700
commit30de04066d874921b7d721bfcb0f363df8a735f1 (patch)
tree249177289c5f0181e3cd2bebe20a3ac4c00486c5
parent564075c9ad37edc6f63bbb4c372775d422a9e8c7 (diff)
downloadceph-30de04066d874921b7d721bfcb0f363df8a735f1.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.cc9
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;