Skip to content

Commit 23f96d6

Browse files
committed
Avoid to run Beats parser and Beats protocol handler in separate executors group (beatsHandlerExecutorGroup)
1 parent 339913c commit 23f96d6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/org/logstash/beats/Server.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ private class BeatsInitializer extends ChannelInitializer<SocketChannel> {
112112
private final int IDLESTATE_WRITER_IDLE_TIME_SECONDS = 5;
113113

114114
private final EventExecutorGroup idleExecutorGroup;
115-
private final EventExecutorGroup beatsHandlerExecutorGroup;
116115
private final IMessageListener localMessageListener;
117116
private final int localClientInactivityTimeoutSeconds;
118117

@@ -121,7 +120,6 @@ private class BeatsInitializer extends ChannelInitializer<SocketChannel> {
121120
this.localMessageListener = messageListener;
122121
this.localClientInactivityTimeoutSeconds = clientInactivityTimeoutSeconds;
123122
idleExecutorGroup = new DefaultEventExecutorGroup(DEFAULT_IDLESTATEHANDLER_THREAD);
124-
beatsHandlerExecutorGroup = new DefaultEventExecutorGroup(beatsHandlerThread);
125123
}
126124

127125
public void initChannel(SocketChannel socket){
@@ -134,7 +132,8 @@ public void initChannel(SocketChannel socket){
134132
new IdleStateHandler(localClientInactivityTimeoutSeconds, IDLESTATE_WRITER_IDLE_TIME_SECONDS, localClientInactivityTimeoutSeconds));
135133
pipeline.addLast(BEATS_ACKER, new AckEncoder());
136134
pipeline.addLast(CONNECTION_HANDLER, new ConnectionHandler());
137-
pipeline.addLast(beatsHandlerExecutorGroup, new BeatsParser(), new BeatsHandler(localMessageListener));
135+
pipeline.addLast(new BeatsParser());
136+
pipeline.addLast(new BeatsHandler(localMessageListener));
138137
}
139138

140139

@@ -152,7 +151,6 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E
152151
public void shutdownEventExecutor() {
153152
try {
154153
idleExecutorGroup.shutdownGracefully().sync();
155-
beatsHandlerExecutorGroup.shutdownGracefully().sync();
156154
} catch (InterruptedException e) {
157155
throw new IllegalStateException(e);
158156
}

0 commit comments

Comments
 (0)