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 2016/03/01 21:14:09 UTC

lucene-solr git commit: SOLR-8771: Multi-threaded core shutdown creates executor per core.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 6261767b3 -> 0f4f53a8f


SOLR-8771: Multi-threaded core shutdown creates executor per core.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0f4f53a8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0f4f53a8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0f4f53a8

Branch: refs/heads/master
Commit: 0f4f53a8f52cab0838bea2482aaa7d5012c5ecaa
Parents: 6261767
Author: Mark Miller <ma...@gmail.com>
Authored: Tue Mar 1 12:13:56 2016 -0800
Committer: Mark Miller <ma...@gmail.com>
Committed: Tue Mar 1 12:13:56 2016 -0800

----------------------------------------------------------------------
 solr/CHANGES.txt                                      |  2 ++
 .../core/src/java/org/apache/solr/core/SolrCores.java | 14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0f4f53a8/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c0d3d86..77511cd 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-leader
   cloud 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 been

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0f4f53a8/solr/core/src/java/org/apache/solr/core/SolrCores.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCores.java b/solr/core/src/java/org/apache/solr/core/SolrCores.java
index 5980ca1..86fab0d 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>() {
             @Override
             public SolrCore call() throws Exception {
@@ -144,11 +144,11 @@ class SolrCores {
               return core;
             }
           });
-        } finally {
-          ExecutorUtil.shutdownAndAwaitTermination(coreCloseExecutor);
         }
-
+      } finally {
+        ExecutorUtil.shutdownAndAwaitTermination(coreCloseExecutor);
       }
+
     } while (coreList.size() > 0);
   }