Skip to content

Commit 5712e66

Browse files
authored
Name netty threads with plugin id and their purpose (#191)
1 parent e6ec307 commit 5712e66

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.1.1
2+
- Properly naming netty threads [#191](https://github.com/logstash-plugins/logstash-input-http/pull/191)
3+
14
## 4.1.0
25
- add improved proactive rate-limiting, rejecting new requests when queue has been actively blocking for more than 10 seconds [#186](https://github.com/logstash-plugins/logstash-input-http/pull/186)
36
- This is a forward-port of functionality also introduced to the 3.x series in v3.10.0

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0
1+
4.1.1

lib/logstash/inputs/http.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def setup_ssl_params!
324324

325325
def create_http_server(message_handler)
326326
org.logstash.plugins.inputs.http.NettyHttpServer.new(
327-
@host, @port, message_handler, build_ssl_params, @threads, @max_pending_requests, @max_content_length, @response_code)
327+
@id, @host, @port, message_handler, build_ssl_params, @threads,
328+
@max_pending_requests, @max_content_length, @response_code)
328329
end
329330

330331
def build_ssl_params

src/main/java/org/logstash/plugins/inputs/http/NettyHttpServer.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public class NettyHttpServer implements Runnable, Closeable {
3131
private final ThreadPoolExecutor executorGroup;
3232
private final HttpResponseStatus responseStatus;
3333

34-
public NettyHttpServer(String host, int port, IMessageHandler messageHandler,
35-
SslHandlerProvider sslHandlerProvider, int threads,
36-
int maxPendingRequests, int maxContentLength, int responseCode)
34+
public NettyHttpServer(final String id, final String host, final int port, final IMessageHandler messageHandler,
35+
final SslHandlerProvider sslHandlerProvider, final int threads,
36+
final int maxPendingRequests, final int maxContentLength, final int responseCode)
3737
{
3838
this.host = host;
3939
this.port = port;
@@ -42,12 +42,12 @@ public NettyHttpServer(String host, int port, IMessageHandler messageHandler,
4242
// boss group is responsible for accepting incoming connections and sending to worker loop
4343
// process group is channel handler, see the https://github.com/netty/netty/discussions/13305
4444
// see the https://github.com/netty/netty/discussions/11808#discussioncomment-1610918 for why separation is good
45-
bossGroup = new NioEventLoopGroup(1, daemonThreadFactory("http-input-connector"));
46-
processorGroup = new NioEventLoopGroup(threads, daemonThreadFactory("http-input-processor"));
45+
bossGroup = new NioEventLoopGroup(1, daemonThreadFactory(id + "-bossGroup"));
46+
processorGroup = new NioEventLoopGroup(threads, daemonThreadFactory(id + "-processorGroup"));
4747

4848
// event handler group
4949
executorGroup = new ThreadPoolExecutor(threads, threads, 0, TimeUnit.MILLISECONDS,
50-
new ArrayBlockingQueue<>(maxPendingRequests), daemonThreadFactory("http-input-handler-executor"),
50+
new ArrayBlockingQueue<>(maxPendingRequests), daemonThreadFactory(id + "-executorGroup"),
5151
new CustomRejectedExecutionHandler());
5252

5353
final HttpInitializer httpInitializer = new HttpInitializer(messageHandler, executorGroup,

0 commit comments

Comments
 (0)