Skip to content

Commit

Permalink
[ISSUE apache#7579] Fix globalWhiteRemoteAddressStrategy cocurrent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leizhiyuan authored and ChineseTony committed Mar 9, 2024
1 parent 75853eb commit 4b88937
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
import org.apache.rocketmq.acl.PermissionChecker;
Expand Down Expand Up @@ -62,7 +63,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();

Expand Down Expand Up @@ -115,7 +116,7 @@ public void load() {

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<>();

Expand Down

0 comments on commit 4b88937

Please sign in to comment.