You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/14 14:31:10 UTC

[lucene-solr] 02/02: #138 - Min 2 per thread thread pool size (from 1).

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit e7d632720b11b00570d38ef3648bb223ab863479
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Jul 14 09:30:44 2020 -0500

    #138 - Min 2 per thread thread pool size (from 1).
---
 solr/solrj/src/java/org/apache/solr/common/ParWork.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/common/ParWork.java b/solr/solrj/src/java/org/apache/solr/common/ParWork.java
index acafafe..e9c23d1 100644
--- a/solr/solrj/src/java/org/apache/solr/common/ParWork.java
+++ b/solr/solrj/src/java/org/apache/solr/common/ParWork.java
@@ -564,16 +564,16 @@ public class ParWork implements Closeable {
     if (ourLoad > 1) {
       int cMax = executor.getMaximumPoolSize();
       if (cMax > 2) {
-        executor.setMaximumPoolSize(Math.max(1, (int) ((double)cMax * 0.60D)));
+        executor.setMaximumPoolSize(Math.max(2, (int) ((double)cMax * 0.60D)));
       }
     } else {
       double sLoad = load / (double) PROC_COUNT;
       if (sLoad > 1.0D) {
         int cMax =  executor.getMaximumPoolSize();
         if (cMax > 2) {
-          executor.setMaximumPoolSize(Math.max(1, (int) ((double) cMax * 0.60D)));
+          executor.setMaximumPoolSize(Math.max(2, (int) ((double) cMax * 0.60D)));
         }
-      } else if (sLoad < 0.9D && MAXIMUM_POOL_SIZE !=  executor.getMaximumPoolSize()) {
+      } else if (sLoad < 0.9D && MAXIMUM_POOL_SIZE != executor.getMaximumPoolSize()) {
         executor.setMaximumPoolSize(MAXIMUM_POOL_SIZE);
       }
       log.info("external request, load:" + sLoad); //nocommit: remove when testing is done