Skip to content

Commit

Permalink
[ISSUE #8720] Support disable netty server worker group by config
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhimins committed Sep 20, 2024
1 parent 0d6c94b commit 19a0bce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ public void run(Timeout timeout) {
*/
protected ChannelPipeline configChannel(SocketChannel ch) {
return ch.pipeline()
.addLast(defaultEventExecutorGroup, HANDSHAKE_HANDLER_NAME, new HandshakeHandler())
.addLast(defaultEventExecutorGroup,
.addLast(nettyServerConfig.isServerNettyWorkerGroupEnable() ? defaultEventExecutorGroup : null,
HANDSHAKE_HANDLER_NAME, new HandshakeHandler())
.addLast(nettyServerConfig.isServerNettyWorkerGroupEnable() ? defaultEventExecutorGroup : null,
encoder,
new NettyDecoder(),
distributionHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class NettyServerConfig implements Cloneable {
private int writeBufferHighWaterMark = NettySystemConfig.writeBufferHighWaterMark;
private int writeBufferLowWaterMark = NettySystemConfig.writeBufferLowWaterMark;
private int serverSocketBacklog = NettySystemConfig.socketBacklog;
private boolean serverNettyWorkerGroupEnable = true;
private boolean serverPooledByteBufAllocatorEnable = true;

private boolean enableShutdownGracefully = false;
Expand Down Expand Up @@ -175,6 +176,14 @@ public void setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
this.writeBufferHighWaterMark = writeBufferHighWaterMark;
}

public boolean isServerNettyWorkerGroupEnable() {
return serverNettyWorkerGroupEnable;
}

public void setServerNettyWorkerGroupEnable(boolean serverNettyWorkerGroupEnable) {
this.serverNettyWorkerGroupEnable = serverNettyWorkerGroupEnable;
}

public boolean isEnableShutdownGracefully() {
return enableShutdownGracefully;
}
Expand Down

0 comments on commit 19a0bce

Please sign in to comment.