Skip to content

Commit 269d10a

Browse files
properly set thread name in thread context (#10273)
1 parent 466070d commit 269d10a

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
@@ -216,11 +216,11 @@ def start_workers
216216

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

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)