]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Mon: Fix decoded message leak when this monitor is leader
authorHaomai Wang <haomai@xsky.com>
Fri, 2 Oct 2015 11:14:59 +0000 (19:14 +0800)
committerSage Weil <sage@redhat.com>
Sat, 3 Oct 2015 16:40:40 +0000 (12:40 -0400)
Fix #13109
Signed-off-by: Haomai Wang <haomai@xsky.com>
Reviewed-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index b49578d3906d4a89b12f87835d42d6b26f128393..7dff5face4f0d46bb9465e6edff9635a3b6f87a8 100644 (file)
@@ -3311,16 +3311,14 @@ void Monitor::resend_routed_requests()
        ++p) {
     RoutedRequest *rr = p->second;
 
-    bufferlist::iterator q = rr->request_bl.begin();
-    PaxosServiceMessage *req = (PaxosServiceMessage *)decode_message(cct, 0, q);
-
     if (mon == rank) {
-      dout(10) << " requeue for self tid " << rr->tid << " " << *req << dendl;
-      req->set_connection(rr->con);
+      dout(10) << " requeue for self tid " << rr->tid << dendl;
       rr->op->mark_event("retry routed request");
       retry.push_back(new C_RetryMessage(this, rr->op));
       delete rr;
     } else {
+      bufferlist::iterator q = rr->request_bl.begin();
+      PaxosServiceMessage *req = (PaxosServiceMessage *)decode_message(cct, 0, q);
       rr->op->mark_event("resend forwarded message to leader");
       dout(10) << " resend to mon." << mon << " tid " << rr->tid << " " << *req << dendl;
       MForward *forward = new MForward(rr->tid, req, rr->con_features,