properly set thread name in thread context

This commit is contained in:
Colin Surprenant 2019-01-09 18:12:04 -05:00
parent 186a588e57
commit 5591ee7d79
2 changed files with 2 additions and 2 deletions

View file

@ -217,11 +217,11 @@ module LogStash; class JavaPipeline < JavaBasePipeline
pipeline_workers.times do |t|
thread = Thread.new do
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
org.logstash.execution.WorkerLoop.new(
lir_execution, filter_queue_client, @events_filtered, @events_consumed,
@flushRequested, @flushing, @shutdownRequested, @drain_queue).run
end
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
@worker_threads << thread
end

View file

@ -283,9 +283,9 @@ module LogStash; class Pipeline < BasePipeline
pipeline_workers.times do |t|
thread = Thread.new(batch_size, batch_delay, self) do |_b_size, _b_delay, _pipeline|
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
_pipeline.worker_loop(_b_size, _b_delay)
end
Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
@worker_threads << thread
end