Skip to content

Commit

Permalink
Add debug log for determining the number of output workers for output…
Browse files Browse the repository at this point in the history
… delegator

Fixes #4391
  • Loading branch information
andrewvc committed Jan 7, 2016
1 parent b7979eb commit d93b4d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions logstash-core/lib/logstash/output_delegator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def initialize(logger, klass, default_worker_count, *args)
# DO NOT move this statement before the instantiation of the first single instance
# Read the note above to understand why
@worker_count = calculate_worker_count(default_worker_count)
@logger.debug("Will start workers for output", :worker_count => @worker_count, :class => klass)

warn_on_worker_override!
# This queue is used to manage sharing across threads
@worker_queue = SizedQueue.new(@worker_count)
Expand Down
4 changes: 4 additions & 0 deletions logstash-core/spec/logstash/output_delegator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def register
let(:default_worker_count) { 2 }
let(:out_klass) { LogStash::Outputs::NOOPDelLegacyNoWorkers }

before do
allow(logger).to receive(:debug).with(any_args)
end

it "should only setup one worker" do
expect(subject.worker_count).to eql(1)
end
Expand Down

0 comments on commit d93b4d6

Please sign in to comment.