Apache Lucene open-source search software
SOLR-8771: Multi-threaded core shutdown creates executor per core.
Mark Miller0f4f53a8f52c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex c0d3d8694e5..77511cd701b 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -231,6 +231,8 @@ Bug Fixes* SOLR-8738: Fixed false success response when invalid deleteByQuery requests intially hit non-leadercloud nodes (hossman)+* SOLR-8771: Multi-threaded core shutdown creates executor per core. (Mike Drob via Mark Miller)+Optimizations----------------------* SOLR-7876: Speed up queries and operations that use many terms when timeAllowed has not beendiff --git a/solr/core/src/java/org/apache/solr/core/SolrCores.java b/solr/core/src/java/org/apache/solr/core/SolrCores.javaindex 5980ca194ee..86fab0d8223 100644--- a/solr/core/src/java/org/apache/solr/core/SolrCores.java+++ b/solr/core/src/java/org/apache/solr/core/SolrCores.java@@ -123,10 +123,10 @@ class SolrCores {pendingCloses.clear();}- for (SolrCore core : coreList) {- ExecutorService coreCloseExecutor = ExecutorUtil.newMDCAwareFixedThreadPool(Integer.MAX_VALUE,- new DefaultSolrThreadFactory("coreCloseExecutor"));- try {+ ExecutorService coreCloseExecutor = ExecutorUtil.newMDCAwareFixedThreadPool(Integer.MAX_VALUE,+ new DefaultSolrThreadFactory("coreCloseExecutor"));+ try {+ for (SolrCore core : coreList) {coreCloseExecutor.submit(new Callable<SolrCore>() {@Overridepublic SolrCore call() throws Exception {@@ -144,11 +144,11 @@ class SolrCores {return core;}});- } finally {- ExecutorUtil.shutdownAndAwaitTermination(coreCloseExecutor);}-+ } finally {+ ExecutorUtil.shutdownAndAwaitTermination(coreCloseExecutor);}+} while (coreList.size() > 0);}