You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2018/12/14 03:58:47 UTC

[1/2] lucene-solr:master: SOLR-13043: cleanup suspicious ExecutorService lifecycles in MiniSolrCloudCluster

Repository: lucene-solr
Updated Branches:
  refs/heads/master d3ee925bd -> 774e9aefb


SOLR-13043: cleanup suspicious ExecutorService lifecycles in MiniSolrCloudCluster


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

Branch: refs/heads/master
Commit: df07fb33bb2ea0ece6ad9229a50c9661d710fdbe
Parents: f844461
Author: Chris Hostetter <ho...@apache.org>
Authored: Thu Dec 13 19:59:35 2018 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Thu Dec 13 19:59:35 2018 -0700

----------------------------------------------------------------------
 .../apache/solr/cloud/MiniSolrCloudCluster.java  | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/df07fb33/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
index 9b52b80..fd719ed 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
@@ -122,9 +122,6 @@ public class MiniSolrCloudCluster {
   private final CloudSolrClient solrClient;
   private final JettyConfig jettyConfig;
 
-  private final ExecutorService executorLauncher = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("jetty-launcher"));
-  private final ExecutorService executorCloser = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("jetty-closer"));
-  
   private final AtomicInteger nodeIds = new AtomicInteger();
 
   /**
@@ -272,7 +269,9 @@ public class MiniSolrCloudCluster {
       startups.add(() -> startJettySolrRunner(newNodeName(), jettyConfig.context, jettyConfig));
     }
 
+    final ExecutorService executorLauncher = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("jetty-launcher"));
     Collection<Future<JettySolrRunner>> futures = executorLauncher.invokeAll(startups);
+    ExecutorUtil.shutdownAndAwaitTermination(executorLauncher);
     Exception startupError = checkForExceptions("Error starting up MiniSolrCloudCluster", futures);
     if (startupError != null) {
       try {
@@ -294,10 +293,6 @@ public class MiniSolrCloudCluster {
 
   private void waitForAllNodes(int numServers, int timeoutSeconds) throws IOException, InterruptedException, TimeoutException {
     
-    executorLauncher.shutdown();
-    
-    ExecutorUtil.shutdownAndAwaitTermination(executorLauncher);
-    
     int numRunning = 0;
     TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME);
     
@@ -327,10 +322,6 @@ public class MiniSolrCloudCluster {
   public void waitForNode(JettySolrRunner jetty, int timeoutSeconds)
       throws IOException, InterruptedException, TimeoutException {
 
-    executorLauncher.shutdown();
-
-    ExecutorUtil.shutdownAndAwaitTermination(executorLauncher);
-
     ZkStateReader reader = getSolrClient().getZkStateReader();
 
     reader.waitForLiveNodes(30, TimeUnit.SECONDS, (o, n) -> n.contains(jetty.getNodeName()));
@@ -577,21 +568,19 @@ public class MiniSolrCloudCluster {
     try {
     
       IOUtils.closeQuietly(solrClient);
-      // accept no new tasks
-      executorLauncher.shutdown();
       List<Callable<JettySolrRunner>> shutdowns = new ArrayList<>(jettys.size());
       for (final JettySolrRunner jetty : jettys) {
         shutdowns.add(() -> stopJettySolrRunner(jetty));
       }
       jettys.clear();
+      final ExecutorService executorCloser = ExecutorUtil.newMDCAwareCachedThreadPool(new SolrjNamedThreadFactory("jetty-closer"));
       Collection<Future<JettySolrRunner>> futures = executorCloser.invokeAll(shutdowns);
+      ExecutorUtil.shutdownAndAwaitTermination(executorCloser);
       Exception shutdownError = checkForExceptions("Error shutting down MiniSolrCloudCluster", futures);
       if (shutdownError != null) {
         throw shutdownError;
       }
     } finally {
-      ExecutorUtil.shutdownAndAwaitTermination(executorLauncher);
-      ExecutorUtil.shutdownAndAwaitTermination(executorCloser);
       try {
         if (!externalZkServer) {
           zkServer.shutdown();


[2/2] lucene-solr:master: Merge remote-tracking branch 'refs/remotes/origin/master'

Posted by ho...@apache.org.
Merge remote-tracking branch 'refs/remotes/origin/master'


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

Branch: refs/heads/master
Commit: 774e9aefbcd1016f1681f13409b37d9b1068af37
Parents: df07fb3 d3ee925
Author: Chris Hostetter <ho...@apache.org>
Authored: Thu Dec 13 20:58:12 2018 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Thu Dec 13 20:58:12 2018 -0700

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   7 +++++--
 .../org/apache/lucene/index/index.7.6.0-cfs.zip    | Bin 0 -> 15655 bytes
 .../org/apache/lucene/index/index.7.6.0-nocfs.zip  | Bin 0 -> 15649 bytes
 .../test/org/apache/lucene/index/sorted.7.6.0.zip  | Bin 0 -> 74541 bytes
 4 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------