From: Yingxin Cheng Date: Thu, 31 Jan 2019 07:48:24 +0000 (+0800) Subject: crimson/net: fix memory leak X-Git-Tag: v14.1.0~155^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be9a832ad9097df34f04bcd5feb740870337a22b;p=ceph.git crimson/net: fix memory leak Do not enqueue sent before lossless policy implemented, it is causing memory leak. Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index da5b1dba992b..b9a4fecb5eb3 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -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)