PERFORMANCE: Remve needless locking on batch reads

Fixes #7623
This commit is contained in:
Armin 2017-07-09 17:49:13 +02:00 committed by Armin Braun
parent 96ff365997
commit dfb423a60f

View file

@ -6,7 +6,7 @@ module LogStash; module Util
java_import java.util.concurrent.TimeUnit
def initialize
@queue = java.util.concurrent.SynchronousQueue.new
@queue = SynchronousQueue.new
end
# Push an object to the queue if the queue is full
@ -103,12 +103,7 @@ module LogStash; module Util
def read_batch
batch = new_batch
@mutex.lock
begin
batch.read_next
ensure
@mutex.unlock
end
batch.read_next
start_metrics(batch)
batch
end