]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix occasional message leak after session reset
authorSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 20:05:35 +0000 (13:05 -0700)
committerSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 20:05:35 +0000 (13:05 -0700)
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 <sage@redhat.com>
src/mon/Monitor.cc

index 1c75c74268c0d8747ef636926628f64b1c27a6a6..94b2d8d8cacd413cde7df18400d180150b1b76d5 100644 (file)
@@ -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) {