Hack to work around some issues with multiple filter workers; realistically this may require some extra work to fix the design probelm found - for multiple filter workers, all filter instances are shared among filter worekrs. This may be undesirable?

This commit is contained in:
Jordan Sissel 2013-08-26 18:52:11 +00:00
parent 915cae3c7b
commit d73d2ced7b

View file

@ -130,6 +130,7 @@ class LogStash::Pipeline
end
def start_filters
@filters.each(&:register)
@filter_threads = @settings["filter-workers"].times.collect do
Thread.new { filterworker }
end
@ -170,11 +171,14 @@ class LogStash::Pipeline
def filterworker
LogStash::Util::set_thread_name("|worker")
@filters.each(&:register)
begin
while true
event = @input_to_filter.pop
break if event == LogStash::ShutdownSignal
if event == LogStash::ShutdownSignal
@input_to_filter.push(event)
break
end
# TODO(sissel): we can avoid the extra array creation here
# if we don't guarantee ordering of origin vs created events.