From 19df386b2d36d716be2e6d02de0386fac9e7bc1f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 21 Aug 2014 13:05:35 -0700 Subject: [PATCH] mon: fix occasional message leak after session reset Consider: - we get a message, put it on a wait list - the client session resets - we go back to process the message later and discard - _ms_dispatch returns false, but nobody drops the msg ref Since we call _ms_dispatch() a lot internally, we need to always return true when we are an internal caller. Fixes: #9176 Backport: firefly, dumpling Signed-off-by: Sage Weil --- src/mon/Monitor.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 1c75c74268c0..94b2d8d8cacd 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2939,8 +2939,9 @@ bool Monitor::_ms_dispatch(Message *m) return dispatch(s, m, false); } dout(1) << __func__ << " dropping stray message " << *m - << " from " << m->get_source_inst() << dendl; - return false; + << " from " << m->get_source_inst() << dendl; + m->put(); + return true; } if (!exited_quorum.is_zero() && !src_is_mon) { -- 2.47.3