]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: fix memory leak
authorYingxin Cheng <yingxincheng@gmail.com>
Thu, 31 Jan 2019 07:48:24 +0000 (15:48 +0800)
committerYingxin Cheng <yingxincheng@gmail.com>
Tue, 12 Feb 2019 08:48:03 +0000 (16:48 +0800)
Do not enqueue sent before lossless policy implemented, it is causing
memory leak.

Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
src/crimson/net/SocketConnection.cc

index da5b1dba992b59fea59fe97135b3ebf99546b0e9..b9a4fecb5eb3f6030d674b5347a58843ed4397f0 100644 (file)
@@ -276,12 +276,13 @@ seastar::future<> SocketConnection::write_message(MessageRef msg)
     bl.append((const char*)&old_footer, sizeof(old_footer));
   }
   // write as a seastar::net::packet
-  return socket->write_flush(std::move(bl))
-    .then([this, msg = std::move(msg)] {
-      if (!policy.lossy) {
-        sent.push(std::move(msg));
-      }
-    });
+  return socket->write_flush(std::move(bl));
+  // TODO: lossless policy
+  //  .then([this, msg = std::move(msg)] {
+  //    if (!policy.lossy) {
+  //      sent.push(std::move(msg));
+  //    }
+  //  });
 }
 
 seastar::future<> SocketConnection::do_send(MessageRef msg)