Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-8255: MiniSolrCloudCluster should use a thread-safe list to hold its child nodes

Alan Woodward4921f135763e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2a7283afca6..f25e600fd1f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -348,6 +348,9 @@ Bug Fixes
* SOLR-8223: Avoid accidentally swallowing OutOfMemoryError (in LeaderInitiatedRecoveryThread.java
or CoreContainer.java) (Mike Drob via Christine Poerschke)
+* SOLR-8255: MiniSolrCloudCluster needs to use a thread-safe list to keep track
+ of its child nodes (Alan Woodward)
+
Optimizations
----------------------
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 7f0c54813ad..205ce8178da 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;