From dfb423a60f5d0b9321b47a581756859b5a2f1fe4 Mon Sep 17 00:00:00 2001 From: Armin Date: Sun, 9 Jul 2017 17:49:13 +0200 Subject: [PATCH] PERFORMANCE: Remve needless locking on batch reads Fixes #7623 --- .../lib/logstash/util/wrapped_synchronous_queue.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb b/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb index 78f530760..d217e80bb 100644 --- a/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb +++ b/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb @@ -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