Skip to content

Commit 5591ee7

Browse files
properly set thread name in thread context
1 parent 186a588 commit 5591ee7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

logstash-core/lib/logstash/java_pipeline.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ def start_workers
217217

218218
pipeline_workers.times do |t|
219219
thread = Thread.new do
220+
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
220221
org.logstash.execution.WorkerLoop.new(
221222
lir_execution, filter_queue_client, @events_filtered, @events_consumed,
222223
@flushRequested, @flushing, @shutdownRequested, @drain_queue).run
223224
end
224-
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
225225
@worker_threads << thread
226226
end
227227

logstash-core/lib/logstash/pipeline.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ def start_workers
283283

284284
pipeline_workers.times do |t|
285285
thread = Thread.new(batch_size, batch_delay, self) do |_b_size, _b_delay, _pipeline|
286+
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
286287
_pipeline.worker_loop(_b_size, _b_delay)
287288
end
288-
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
289289
@worker_threads << thread
290290
end
291291

0 commit comments

Comments
 (0)