[ 
https://issues.apache.org/jira/browse/SOLR-8255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14996354#comment-14996354
 ] 

Alan Woodward commented on SOLR-8255:
-------------------------------------

Simple patch:
{code}
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 7f0c548..205ce81 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
@@ -26,11 +26,11 @@ import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
 import java.util.concurrent.Callable;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
@@ -89,7 +89,7 @@ public class MiniSolrCloudCluster {

   private final ZkTestServer zkServer;
   private final boolean externalZkServer;
-  private final List<JettySolrRunner> jettys = new LinkedList<>();
+  private final List<JettySolrRunner> jettys = new CopyOnWriteArrayList<>();
   private final Path baseDir;
   private final CloudSolrClient solrClient;
   private final JettyConfig jettyConfig;
{code}

> MiniSolrCloudCluster doesn't use a thread-safe list for its jetties
> -------------------------------------------------------------------
>
>                 Key: SOLR-8255
>                 URL: https://issues.apache.org/jira/browse/SOLR-8255
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>
> MiniSolrCloudCluster uses a LinkedList<> to hold its jetties.  However, 
> multi-threaded startup can break this because the list isn't thread safe.  We 
> should use CopyOnWriteArrayList instead.
> See for example 
> http://jenkins.thetaphi.de/job/Lucene-Solr-trunk-Linux/14819/, which starts 
> up 5 nodes but then only has 4 entries in its jetty list, causing assertion 
> errors and thread leaks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to