You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2018/08/20 07:57:20 UTC

[1/2] lucene-solr:branch_7x: SOLR-12679: MiniSolrCloudCluster.stopJettySolrRunner should remove jetty from the internal list

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x d1fdc4d63 -> 797883c77


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.

(cherry picked from commit ee498f5a38c0454f6649e78f71c74d4bb2da1228)


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

Branch: refs/heads/branch_7x
Commit: faf3eaabf0bbcbad161805e8e53b68e4cdc34d47
Parents: d1fdc4d
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:26:57 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/faf3eaab/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 73d102b..4915735 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -204,6 +204,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/faf3eaab/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/faf3eaab/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;
   }
 


[2/2] lucene-solr:branch_7x: SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent

Posted by sh...@apache.org.
SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent

(cherry picked from commit 20d0f67edd15b03a072e745373297c1886d72f24)


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

Branch: refs/heads/branch_7x
Commit: 797883c779b44a281984dd7d5f401bb4057a9428
Parents: faf3eaa
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Mon Aug 20 13:25:56 2018 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Mon Aug 20 13:27:06 2018 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 ++
 .../TestSolrConfigHandlerConcurrent.java        | 38 ++++++++++----------
 2 files changed, 22 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/797883c7/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 4915735..38271f6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -274,6 +274,8 @@ Other Changes
 
 * SOLR-12014: Cryptic error message when creating a collection with sharding that violates autoscaling policies (noble)
 
+* SOLR-12680: Fix ClassCastException and AIOOBE in TestSolrConfigHandlerConcurrent. (shalin)
+
 ==================  7.4.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/797883c7/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
index bf982ad..8af461b 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java
@@ -65,21 +65,23 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
     for (Object o : caches.entrySet()) {
       final Map.Entry e = (Map.Entry) o;
-      Thread t = new Thread() {
-        @Override
-        public void run() {
-          try {
-            ArrayList errs = new ArrayList();
-            collectErrors.add(errs);
-            invokeBulkCall((String)e.getKey() , errs, (Map) e.getValue());
-          } catch (Exception e) {
-            e.printStackTrace();
+      if (e.getValue() instanceof Map) {
+        Map value = (Map) e.getValue();
+        Thread t = new Thread() {
+          @Override
+          public void run() {
+            try {
+              List<String> errs = new ArrayList<>();
+              collectErrors.add(errs);
+              invokeBulkCall((String)e.getKey() , errs, value);
+            } catch (Exception e) {
+              e.printStackTrace();
+            }
           }
-
-        }
-      };
-      threads.add(t);
-      t.start();
+        };
+        threads.add(t);
+        t.start();
+      }
     }
 
 
@@ -146,7 +148,7 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
 
       //get another node
-      String url = urls.get(urls.size());
+      String url = urls.get(urls.size() - 1);
 
       long startTime = System.nanoTime();
       long maxTimeoutSeconds = 20;
@@ -163,13 +165,13 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
 
 
         Object o = getObjectByPath(m, true, asList("query", cacheName, "size"));
-        if(!val1.equals(o)) errmessages.add(StrUtils.formatString("'size' property not set, expected = {0}, actual {1}", val1, o));
+        if(!val1.equals(o.toString())) errmessages.add(StrUtils.formatString("'size' property not set, expected = {0}, actual {1}", val1, o));
 
         o = getObjectByPath(m, true, asList("query", cacheName, "initialSize"));
-        if(!val2.equals(o)) errmessages.add(StrUtils.formatString("'initialSize' property not set, expected = {0}, actual {1}", val2, o));
+        if(!val2.equals(o.toString())) errmessages.add(StrUtils.formatString("'initialSize' property not set, expected = {0}, actual {1}", val2, o));
 
         o = getObjectByPath(m, true, asList("query", cacheName, "autowarmCount"));
-        if(!val3.equals(o)) errmessages.add(StrUtils.formatString("'autowarmCount' property not set, expected = {0}, actual {1}", val3, o));
+        if(!val3.equals(o.toString())) errmessages.add(StrUtils.formatString("'autowarmCount' property not set, expected = {0}, actual {1}", val3, o));
         if(errmessages.isEmpty()) break;
       }
       if(!errmessages.isEmpty()) {