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

Backport #191: Name netty threads with plugin id and their purpose #192

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.10.1
- Properly naming netty threads [#191](https://github.com/logstash-plugins/logstash-input-http/pull/191)

## 3.10.0
- 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)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0
3.10.1
3 changes: 2 additions & 1 deletion lib/logstash/inputs/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ def normalize_ssl_client_authentication_value!(verify_mode, ssl_verify_mode)

def create_http_server(message_handler)
org.logstash.plugins.inputs.http.NettyHttpServer.new(
@host, @port, message_handler, build_ssl_params, @threads, @max_pending_requests, @max_content_length, @response_code)
@id, @host, @port, message_handler, build_ssl_params, @threads,
@max_pending_requests, @max_content_length, @response_code)
end

def build_ssl_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public class NettyHttpServer implements Runnable, Closeable {
private final ThreadPoolExecutor executorGroup;
private final HttpResponseStatus responseStatus;

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

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

final HttpInitializer httpInitializer = new HttpInitializer(messageHandler, executorGroup,
Expand Down