Skip to content

Commit 98ea405

Browse files
jsvdmashhurs
andauthored
Backport #191: Name netty threads with plugin id and their purpose (#192)
Co-authored-by: Mashhur <[email protected]>
1 parent 9546e28 commit 98ea405

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+
## 3.10.1
2+
- Properly naming netty threads [#191](https://github.com/logstash-plugins/logstash-input-http/pull/191)
3+
14
## 3.10.0
25
- add improved proactive rate-limiting, rejecting new requests when queue has been actively blocking for more than 10 seconds [#179](https://github.com/logstash-plugins/logstash-input-http/pull/179)
36

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.0
1+
3.10.1

lib/logstash/inputs/http.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ def normalize_ssl_client_authentication_value!(verify_mode, ssl_verify_mode)
391391

392392
def create_http_server(message_handler)
393393
org.logstash.plugins.inputs.http.NettyHttpServer.new(
394-
@host, @port, message_handler, build_ssl_params, @threads, @max_pending_requests, @max_content_length, @response_code)
394+
@id, @host, @port, message_handler, build_ssl_params, @threads,
395+
@max_pending_requests, @max_content_length, @response_code)
395396
end
396397

397398
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)