i3wangyi opened a new issue #784: ConcurrentModificationException during mvn test URL: https://github.com/apache/helix/issues/784 @narendly reported the stack trace of a problematic exception ``` 22723 [ZkClient-EventThread-752-localhost:2183] ERROR org.apache.helix.manager.zk.ZKExceptionHandler - exception in handling data-change. path: /TestHelixAdminCli_grand/INSTANCES/controller_9000/CURRENTSTATES/10014b003960037/TestHelixAdminCli, listener: org.apache.helix.controller.GenericHelixController@64b7b07 java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442) at java.util.HashMap$KeyIterator.next(HashMap.java:1466) at org.apache.helix.controller.stages.ClusterEvent.clone(ClusterEvent.java:119) at org.apache.helix.controller.GenericHelixController.pushToEventQueues(GenericHelixController.java:1010) at org.apache.helix.controller.GenericHelixController.onStateChange(GenericHelixController.java:826) at org.apache.helix.manager.zk.CallbackHandler.invoke(CallbackHandler.java:418) at org.apache.helix.manager.zk.CallbackHandler.enqueueTask(CallbackHandler.java:341) at org.apache.helix.manager.zk.CallbackHandler.handleDataChange(CallbackHandler.java:625) at org.apache.helix.zookeeper.zkclient.ZkClient$6.run(ZkClient.java:1305) at org.apache.helix.zookeeper.zkclient.ZkEventThread.run(ZkEventThread.java:90) true: wait 426ms, ClusterStateVerifier$BestPossAndExtViewZkVerifier(TestHelixAdminCli@localhost:2183) true: wait 250ms, ClusterStateVerifier$BestPossAndExtViewZkVerifier(TestHelixAdminCli@localhost:2183) END testDropAddResource at Thu Feb 13 14:50:12 PST 2020, took: 3075ms. START testInstanceOperations at Thu Feb 13 14:50:12 PST 2020 ``` The root cause is: In ClusterEvent.java, the hashmap update itself while in its for loop ``` for (String attributeName : _eventAttributeMap.keySet()) { newEvent.addAttribute(attributeName, _eventAttributeMap.get(attributeName)); } public void addAttribute(String attrName, Object attrValue) { if (logger.isTraceEnabled()) { logger.trace("Adding attribute:" + attrName); logger.trace(" attribute value:" + attrValue); } _eventAttributeMap.put(attrName, attrValue); } ```
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
