Skip to content
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

benchmarks: fix missing configuration for netty server #6877

Merged
merged 2 commits into from Mar 31, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -40,6 +40,8 @@
import io.netty.channel.local.LocalChannel;
import io.netty.channel.local.LocalServerChannel;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.util.concurrent.DefaultThreadFactory;
import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -206,7 +208,8 @@ public void setup(ExecutorType clientExecutor,
sock.bind(new InetSocketAddress(BENCHMARK_ADDR, 0));
SocketAddress address = sock.getLocalSocketAddress();
sock.close();
serverBuilder = NettyServerBuilder.forAddress(address);
serverBuilder =
NettyServerBuilder.forAddress(address).channelType(NioServerSocketChannel.class);
channelBuilder = NettyChannelBuilder.forAddress(address);
}

Expand All @@ -220,6 +223,7 @@ public void setup(ExecutorType clientExecutor,
// Always use a different worker group from the client.
ThreadFactory serverThreadFactory = new DefaultThreadFactory("STF pool", true /* daemon */);
serverBuilder.workerEventLoopGroup(new NioEventLoopGroup(0, serverThreadFactory));
serverBuilder.bossEventLoopGroup(new NioEventLoopGroup(1, serverThreadFactory));

// Always set connection and stream window size to same value
serverBuilder.flowControlWindow(windowSize.bytes());
Expand Down Expand Up @@ -379,6 +383,7 @@ public void onReady() {
// Use a dedicated event-loop for each channel
channels[i] = channelBuilder
.eventLoopGroup(new NioEventLoopGroup(1, clientThreadFactory))
.channelType(NioSocketChannel.class)
.build();
}
}
Expand Down