This is an automated email from the ASF dual-hosted git repository. jinrongtong pushed a commit to branch 4.9.x in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/4.9.x by this push: new 3a6bf967b5 [ISSUE #7579] Fix globalWhiteRemoteAddressStrategy cocurrent bug 3a6bf967b5 is described below commit 3a6bf967b5b117218e94ab9ec443f6d1df9666e1 Author: Lei Zhiyuan <leizhiy...@gmail.com> AuthorDate: Fri Nov 24 10:55:11 2023 +0800 [ISSUE #7579] Fix globalWhiteRemoteAddressStrategy cocurrent bug --- .../java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java index fc8fd09594..26077135ec 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java @@ -34,6 +34,7 @@ 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.atomic.AtomicLong; import org.apache.commons.lang3.StringUtils; @@ -66,7 +67,7 @@ public class PlainPermissionManager { private Map<String/** AccessKey **/, String/** fileFullPath **/> accessKeyTable = new HashMap<>(); - private List<RemoteAddressStrategy> globalWhiteRemoteAddressStrategy = new ArrayList<>(); + private List<RemoteAddressStrategy> globalWhiteRemoteAddressStrategy = new CopyOnWriteArrayList<>(); private RemoteAddressStrategyFactory remoteAddressStrategyFactory = new RemoteAddressStrategyFactory(); @@ -117,7 +118,7 @@ public class PlainPermissionManager { Map<String, Map<String, PlainAccessResource>> aclPlainAccessResourceMap = new HashMap<>(); Map<String, String> accessKeyTable = new HashMap<>(); - List<RemoteAddressStrategy> globalWhiteRemoteAddressStrategy = new ArrayList<>(); + List<RemoteAddressStrategy> globalWhiteRemoteAddressStrategy = new CopyOnWriteArrayList<>(); Map<String, List<RemoteAddressStrategy>> globalWhiteRemoteAddressStrategyMap = new HashMap<>(); Map<String, DataVersion> dataVersionMap = new HashMap<>();