From be9a832ad9097df34f04bcd5feb740870337a22b Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Thu, 31 Jan 2019 15:48:24 +0800 Subject: [PATCH] crimson/net: fix memory leak Do not enqueue sent before lossless policy implemented, it is causing memory leak. Signed-off-by: Yingxin Cheng --- src/crimson/net/SocketConnection.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index da5b1dba992b5..b9a4fecb5eb3f 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) -- 2.39.5