diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/ThreadPool.java b/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/ThreadPool.java index 10202bfde58..4ba9ec724df 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/ThreadPool.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/ThreadPool.java @@ -183,7 +183,7 @@ public class ThreadPool extends AbstractComponent { logger.debug("creating thread_pool [{}], type [{}], size [{}], queue_size [{}], reject_policy [{}]", name, type, size, queueSize, rejectSetting); return new ThreadPoolExecutor(size, size, 0L, TimeUnit.MILLISECONDS, - queueSize <= 0 ? new LinkedTransferQueue() : new LinkedBlockingQueue(queueSize), + queueSize <= 0 ? new LinkedTransferQueue() : new ArrayBlockingQueue(queueSize), threadFactory, rejectedExecutionHandler); } else if ("scaling".equals(type)) { TimeValue keepAlive = settings.getAsTime("keep_alive", defaultSettings.getAsTime("keep_alive", timeValueMinutes(5))); diff --git a/plugins/river/couchdb/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java b/plugins/river/couchdb/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java index 1311a56cc7b..a3da13c5129 100644 --- a/plugins/river/couchdb/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java +++ b/plugins/river/couchdb/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java @@ -53,8 +53,8 @@ import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.Map; +import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import static org.elasticsearch.client.Requests.*; @@ -164,7 +164,7 @@ public class CouchdbRiver extends AbstractRiverComponent implements River { if (throttleSize == -1) { stream = new LinkedTransferQueue(); } else { - stream = new LinkedBlockingQueue(throttleSize); + stream = new ArrayBlockingQueue(throttleSize); } }