diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java index 34153742b8d..a5a573cc0d9 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java @@ -42,12 +42,12 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.gson.Gson; +import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -174,7 +174,7 @@ public List findNamespaceBOs(String appId, Env env, String clusterN } List namespaceBOs = Collections.synchronizedList(new LinkedList<>()); - List exceptionNamespaces = new CopyOnWriteArrayList<>(); + List exceptionNamespaces = Collections.synchronizedList(new LinkedList<>()); CountDownLatch latch = new CountDownLatch(namespaces.size()); for (NamespaceDTO namespace : namespaces) { executorService.submit(() -> {