You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2018/12/12 21:28:52 UTC
[geode-benchmarks] 02/02: Use a thread safe list of processes in
LocalInfrastructure
This is an automated email from the ASF dual-hosted git repository.
upthewaterspout pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git
commit 8fe5aa0acfd0d247d04915f90812557895026c05
Author: Dan Smith <up...@apache.org>
AuthorDate: Wed Dec 12 13:27:48 2018 -0800
Use a thread safe list of processes in LocalInfrastructure
We're launching processing in parallel, so we need to watch out for race
conditions.
---
.../geode/perftest/infrastructure/local/LocalInfrastructure.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/harness/src/main/java/org/apache/geode/perftest/infrastructure/local/LocalInfrastructure.java b/harness/src/main/java/org/apache/geode/perftest/infrastructure/local/LocalInfrastructure.java
index 88adff5..9bcf27a 100644
--- a/harness/src/main/java/org/apache/geode/perftest/infrastructure/local/LocalInfrastructure.java
+++ b/harness/src/main/java/org/apache/geode/perftest/infrastructure/local/LocalInfrastructure.java
@@ -26,11 +26,11 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Function;
import org.apache.commons.io.FileUtils;
@@ -44,7 +44,7 @@ import org.apache.geode.perftest.infrastructure.Infrastructure;
public class LocalInfrastructure implements Infrastructure {
private final Set<LocalNode> nodes = new LinkedHashSet<>();
- private final List<Process> processList = new ArrayList<Process>();
+ private final List<Process> processList = new CopyOnWriteArrayList<>();
public LocalInfrastructure(int numNodes) throws IOException {
for (int i = 0; i < numNodes; i++) {