From 3763ecba67d108942dcf86fe48851a0fc23f1ff1 Mon Sep 17 00:00:00 2001 From: Joao Duarte Date: Mon, 23 Mar 2015 11:24:54 +0000 Subject: [PATCH] remove deprecation notices when output workers > 1 When workers is set to > 1, new plugin instances are created using a params hash that contains both the user-specified config parameters and the default ones. This causes deprecation notices to be printed, even though the user never specified a deprecated config setting. Thus, new workers should be created using only the "original" set of config parameters. Fixes #2876 --- lib/logstash/outputs/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logstash/outputs/base.rb b/lib/logstash/outputs/base.rb index d1554408d..a7d01cc0d 100644 --- a/lib/logstash/outputs/base.rb +++ b/lib/logstash/outputs/base.rb @@ -69,7 +69,7 @@ class LogStash::Outputs::Base < LogStash::Plugin else define_singleton_method(:handle, method(:handle_worker)) @worker_queue = SizedQueue.new(20) - @worker_plugins = @workers.times.map { self.class.new(params.merge("workers" => 1, "codec" => @codec.clone)) } + @worker_plugins = @workers.times.map { self.class.new(@original_params.merge("workers" => 1, "codec" => @codec.clone)) } @worker_plugins.map.with_index do |plugin, i| Thread.new(original_params, @worker_queue) do |params, queue| LogStash::Util::set_thread_name(">#{self.class.config_name}.#{i}")