Skip to content

Commit d9d2001

Browse files
properly set thread name in thread context (#10270)
1 parent 312e965 commit d9d2001

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
@@ -218,11 +218,11 @@ def start_workers
218218

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

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)