mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 19:15:06 +00:00
SOLR-8748: OverseerTaskProcessor limits number of concurrent tasks to just 10 even though the thread pool size is 100. The limit has now been increased to 100.
This commit is contained in:
parent
41eb5e8542
commit
c59ca69ec0
@ -221,6 +221,9 @@ Bug Fixes
|
|||||||
* SOLR-8420: Fix long overflow in sumOfSquares for Date statistics. (Tom Hill, Christine Poerschke,
|
* SOLR-8420: Fix long overflow in sumOfSquares for Date statistics. (Tom Hill, Christine Poerschke,
|
||||||
Tomás Fernández Löbbe)
|
Tomás Fernández Löbbe)
|
||||||
|
|
||||||
|
* SOLR-8748: OverseerTaskProcessor limits number of concurrent tasks to just 10 even though the thread pool
|
||||||
|
size is 100. The limit has now been increased to 100. (Scott Blum, shalin)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
* SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been
|
* SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not been
|
||||||
|
@ -58,7 +58,11 @@ import static org.apache.solr.common.params.CommonAdminParams.ASYNC;
|
|||||||
*/
|
*/
|
||||||
public class OverseerTaskProcessor implements Runnable, Closeable {
|
public class OverseerTaskProcessor implements Runnable, Closeable {
|
||||||
|
|
||||||
public int maxParallelThreads = 10;
|
/**
|
||||||
|
* Maximum number of overseer collection operations which can be
|
||||||
|
* executed concurrently
|
||||||
|
*/
|
||||||
|
public static final int MAX_PARALLEL_TASKS = 100;
|
||||||
|
|
||||||
public ExecutorService tpe;
|
public ExecutorService tpe;
|
||||||
|
|
||||||
@ -162,7 +166,7 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
|
|||||||
|
|
||||||
// TODO: Make maxThreads configurable.
|
// TODO: Make maxThreads configurable.
|
||||||
|
|
||||||
this.tpe = new ExecutorUtil.MDCAwareThreadPoolExecutor(5, 100, 0L, TimeUnit.MILLISECONDS,
|
this.tpe = new ExecutorUtil.MDCAwareThreadPoolExecutor(5, MAX_PARALLEL_TASKS, 0L, TimeUnit.MILLISECONDS,
|
||||||
new SynchronousQueue<Runnable>(),
|
new SynchronousQueue<Runnable>(),
|
||||||
new DefaultSolrThreadFactory("OverseerThreadFactory"));
|
new DefaultSolrThreadFactory("OverseerThreadFactory"));
|
||||||
try {
|
try {
|
||||||
@ -183,7 +187,7 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
|
|||||||
|
|
||||||
boolean waited = false;
|
boolean waited = false;
|
||||||
|
|
||||||
while (runningTasks.size() > maxParallelThreads) {
|
while (runningTasks.size() > MAX_PARALLEL_TASKS) {
|
||||||
synchronized (waitLock) {
|
synchronized (waitLock) {
|
||||||
waitLock.wait(100);//wait for 100 ms or till a task is complete
|
waitLock.wait(100);//wait for 100 ms or till a task is complete
|
||||||
}
|
}
|
||||||
@ -193,7 +197,7 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
|
|||||||
if (waited)
|
if (waited)
|
||||||
cleanUpWorkQueue();
|
cleanUpWorkQueue();
|
||||||
|
|
||||||
List<QueueEvent> heads = workQueue.peekTopN(maxParallelThreads, runningZKTasks, 2000L);
|
List<QueueEvent> heads = workQueue.peekTopN(MAX_PARALLEL_TASKS, runningZKTasks, 2000L);
|
||||||
|
|
||||||
if (heads == null)
|
if (heads == null)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user