]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: do not leak no_reply messages
authorSage Weil <sage@inktank.com>
Sun, 23 Jun 2013 15:52:46 +0000 (08:52 -0700)
committerSage Weil <sage@inktank.com>
Sun, 23 Jun 2013 15:53:12 +0000 (08:53 -0700)
I think I assumed no_reply() was releasing the references, but it is
not.  Which is better, since send_reply() doesn't either.  Fix the leaks
by dropping the message ref explicitly.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/mon/OSDMonitor.cc

index 9db57b9d93d66a1923c42f2dff8aa0d49e88d60a..76915a5f4a1b9ecea193714d4716495721f316fe 100644 (file)
@@ -968,8 +968,10 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
                      << m->get_orig_source_inst() << "\n";
     failure_info_t& fi = failure_info[target_osd];
     MOSDFailure *old = fi.add_report(reporter, failed_since, m);
-    if (old)
+    if (old) {
       mon->no_reply(old);
+      old->put();
+    }
 
     return check_failure(now, target_osd, fi);
   } else {
@@ -983,6 +985,7 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
       fi.cancel_report(reporter);
       while (!ls.empty()) {
        mon->no_reply(ls.front());
+       ls.front()->put();
        ls.pop_front();
       }
       if (fi.reporters.empty()) {
@@ -997,6 +1000,7 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
       dout(10) << " no failure_info for osd." << target_osd << dendl;
     }
     mon->no_reply(m);
+    m->put();
   }
   
   return false;