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/09/01 18:54:21 UTC
[lucene-solr] 07/11: @673 Try to fix test thread leak in
processExit of thread pool.
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 eaa39be867c343d632a09835972d0b087e5a07b3
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Sep 1 12:48:05 2020 -0500
@673 Try to fix test thread leak in processExit of thread pool.
---
.../src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java | 1 +
solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
index 7a9f7b5..5a417af 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
@@ -258,6 +258,7 @@ public abstract class BaseCloudSolrClient extends SolrClient {
@Override
public void close() throws IOException {
+ if (threadPool != null) threadPool.shutdownNow();
ExecutorUtil.shutdownAndAwaitTermination(threadPool);
}
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
index 0af78c4..9c1565b 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
@@ -91,7 +91,7 @@ public class ExecutorUtil {
try {
// Wait a while for existing tasks to terminate
- shutdown = pool.awaitTermination(30, TimeUnit.SECONDS);
+ shutdown = pool.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException ie) {
interrupted = true;
if (interruptTimeout.hasTimedOut()) {