Skip to content

Remove default netty allocator empty assertions #48356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.elasticsearch;

import io.netty.buffer.PooledByteBufAllocator;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.Plugin;
Expand Down Expand Up @@ -57,11 +56,4 @@ protected Settings nodeSettings(int nodeOrdinal) {
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Collections.singletonList(Netty4Plugin.class);
}

@Override
public void tearDown() throws Exception {
super.tearDown();
assertEquals(0, PooledByteBufAllocator.DEFAULT.metric().usedHeapMemory());
assertEquals(0, PooledByteBufAllocator.DEFAULT.metric().usedDirectMemory());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
Expand Down Expand Up @@ -61,6 +62,7 @@
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.NettyAllocator;
import org.junit.After;
import org.junit.Before;

Expand Down Expand Up @@ -348,7 +350,10 @@ public void dispatchBadRequest(final RestChannel channel,

CountDownLatch channelClosedLatch = new CountDownLatch(1);

Bootstrap clientBootstrap = new Bootstrap().channel(NioSocketChannel.class).handler(new ChannelInitializer<SocketChannel>() {
Bootstrap clientBootstrap = new Bootstrap()
.option(ChannelOption.ALLOCATOR, NettyAllocator.getAllocator())
.channel(NioSocketChannel.class)
.handler(new ChannelInitializer<SocketChannel>() {

@Override
protected void initChannel(SocketChannel ch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.transport.netty4;

import io.netty.buffer.PooledByteBufAllocator;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.cluster.node.DiscoveryNode;
Expand All @@ -46,13 +45,6 @@

public class SimpleNetty4TransportTests extends AbstractSimpleTransportTestCase {

@Override
public void tearDown() throws Exception {
super.tearDown();
assertEquals(0, PooledByteBufAllocator.DEFAULT.metric().usedHeapMemory());
assertEquals(0, PooledByteBufAllocator.DEFAULT.metric().usedDirectMemory());
}

@Override
protected Transport build(Settings settings, final Version version, ClusterSettings clusterSettings, boolean doHandshake) {
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(Collections.emptyList());
Expand Down