You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/08/21 01:31:09 UTC

[42/50] [abbrv] lucene-solr:jira/http2: SOLR-12679: MiniSolrCloudCluster.stopJettySolrRunner should remove jetty from the internal list

SOLR-12679: MiniSolrCloudCluster.stopJettySolrRunner should remove jetty from the internal list

While the startJettySolrRunner adds the given jetty instance to the internal list of jetty instances, the stopJettySolrRunner method does not remove the given instance from the list. This leads to inconsistencies such as stopped jettys retained in the internal list and duplicate (stopped) jettys. This commit also fixes TestCollectionsAPIViaSolrCloudCluster to deal with this change.


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

Branch: refs/heads/jira/http2
Commit: ee498f5a38c0454f6649e78f71c74d4bb2da1228
Parents: 3e45452
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Mon Aug 20 13:17:05 2018 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon Aug 20 13:17:05 2018 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                              | 2 ++
 .../collections/TestCollectionsAPIViaSolrCloudCluster.java    | 2 +-
 .../src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java  | 7 +++++++
 3 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ee498f5a/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 785dada..8f8ffc4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -247,6 +247,8 @@ Bug Fixes
 
 * SOLR-12674: RollupStream should not use the HashQueryParser for 1 worker. (Varun Thacker)
 
+* SOLR-12679: MiniSolrCloudCluster.stopJettySolrRunner should remove jetty from the internal list. (shalin)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ee498f5a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
index 067ec70..6ee616f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionsAPIViaSolrCloudCluster.java
@@ -205,7 +205,7 @@ public class TestCollectionsAPIViaSolrCloudCluster extends SolrCloudTestCase {
     final CloudSolrClient client = cluster.getSolrClient();
 
     assertNotNull(cluster.getZkServer());
-    List<JettySolrRunner> jettys = cluster.getJettySolrRunners();
+    List<JettySolrRunner> jettys = new ArrayList<>(cluster.getJettySolrRunners()); // make a copy
     assertEquals(nodeCount, jettys.size());
     for (JettySolrRunner jetty : jettys) {
       assertTrue(jetty.isRunning());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ee498f5a/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 df458d7..8b442db 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
@@ -427,8 +427,15 @@ public class MiniSolrCloudCluster {
     return jetty;
   }
 
+  /**
+   * Stop the given Solr instance. It will be removed from the cluster's list of running instances.
+   * @param jetty a {@link JettySolrRunner} to be stopped
+   * @return the same {@link JettySolrRunner} instance provided to this method
+   * @throws Exception on error
+   */
   public JettySolrRunner stopJettySolrRunner(JettySolrRunner jetty) throws Exception {
     jetty.stop();
+    jettys.remove(jetty);
     return jetty;
   }