From 403b9389e062b06c84b5ccf01a401d0f630871ea Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Wed, 27 Nov 2019 09:24:16 +0100 Subject: [PATCH] Avoid double-wrapping allocator (#49534) When using unpooled, the allocator is wrapped twice in a NoDirectBuffers. --- .../main/java/org/elasticsearch/transport/NettyAllocator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/NettyAllocator.java b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/NettyAllocator.java index 0ec01ebb28b8f..0b9cee7024a00 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/NettyAllocator.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/NettyAllocator.java @@ -44,7 +44,7 @@ public class NettyAllocator { } else { ByteBufAllocator delegate; if (useUnpooled()) { - delegate = new NoDirectBuffers(UnpooledByteBufAllocator.DEFAULT); + delegate = UnpooledByteBufAllocator.DEFAULT; } else { int nHeapArena = PooledByteBufAllocator.defaultNumHeapArena(); int pageSize = PooledByteBufAllocator.defaultPageSize();