]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: Set add_ref to false when creating a MessageRef in conn::send() 41322/head
authorAmnon Hanuhov <ahanukov@redhat.com>
Tue, 11 May 2021 12:07:35 +0000 (15:07 +0300)
committerKefu Chai <kchai@redhat.com>
Fri, 14 May 2021 03:55:42 +0000 (11:55 +0800)
we should not increase the ref count when transferring the ownership from a
MessageURef instance to a MessageRef instance.

to address the memory leak introduced by
1f6e66470504fe5aec4cae3fc74d6e9927aae7aa.

Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/net/SocketConnection.cc

index 97fc76b730459a45ff3f31cbd0004e7846fee26a..630dbdfa8c8ae7da6fbe12dcf776d3f1eb4c0541 100644 (file)
@@ -72,7 +72,7 @@ bool SocketConnection::peer_wins() const
 seastar::future<> SocketConnection::send(MessageURef msg)
 {
   assert(seastar::this_shard_id() == shard_id());
-  return protocol->send(MessageRef{msg.release()});
+  return protocol->send(MessageRef{msg.release(), false});
 }
 
 seastar::future<> SocketConnection::send(MessageRef msg)