leizhiyuan opened a new issue, #7579:
URL: https://github.com/apache/rocketmq/issues/7579

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   none
   
   ### RocketMQ version
   
   4.9.x and 5.x
   
   ### JDK Version
   
   every
   
   ### Describe the Bug
   
   ```
   java.util.ConcurrentModificationException: null
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:911)
        at java.util.ArrayList$Itr.next(ArrayList.java:861)
        at 
org.apache.rocketmq.acl.plain.PlainPermissionManager.validate(PlainPermissionManager.java:712)
        at 
org.apache.rocketmq.acl.plain.PlainAccessValidator.validate(PlainAccessValidator.java:129)
        at 
org.apache.rocketmq.broker.BrokerController$10.doBeforeRequest(BrokerController.java:636)
        at 
org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.doBeforeRpcHooks(NettyRemotingAbstract.java:171)
        at 
org.apache.rocketmq.remoting.netty.NettyRemotingAbstract$1.run(NettyRemotingAbstract.java:201)
        at 
org.apache.rocketmq.remoting.netty.RequestTask.run(RequestTask.java:80)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
   ```
   
   because acl monitor the change of acl file 
   
   ```
    
this.globalWhiteRemoteAddressStrategy.addAll(globalWhiteRemoteAddressStrategy);
           if (this.globalWhiteRemoteAddressStrategyMap.get(aclFilePath) != 
null) {
               List<RemoteAddressStrategy> remoteAddressStrategyList = 
this.globalWhiteRemoteAddressStrategyMap.get(aclFilePath);
               for (int i = 0; i < remoteAddressStrategyList.size(); i++) {
                   
this.globalWhiteRemoteAddressStrategy.remove(remoteAddressStrategyList.get(i));
               }
               this.globalWhiteRemoteAddressStrategyMap.put(aclFilePath, 
globalWhiteRemoteAddressStrategy);
           }
   ```
   
   it will change globalWhiteRemoteAddressStrategy ,but 
   
   ```
    public void validate(PlainAccessResource plainAccessResource) {
   
           // Check the global white remote addr
           for (RemoteAddressStrategy remoteAddressStrategy : 
globalWhiteRemoteAddressStrategy) {
               if (remoteAddressStrategy.match(plainAccessResource)) {
                   return;
               }
           }
   ```
   
   so one thread read ,another write 
   
   ### Steps to Reproduce
   
   review
   
   ### What Did You Expect to See?
   
   normal
   
   ### What Did You See Instead?
   
   ConcurrentModificationException
   
   ### Additional Context
   
   review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to