elek opened a new pull request #1782: URL: https://github.com/apache/ozone/pull/1782
## What changes were proposed in this pull request? @jojochuang [reported](https://issues.apache.org/jira/browse/HDDS-3918?focusedCommentId=17223103&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17223103) that some `ConcurrentModificationException` is visible even after #1174 (https://issues.apache.org/jira/browse/HDDS-3918) The root cause of this issue is a leak of internal representation of sets in `NodeStateMap`. `NodeStateMap` returns an unmodifiable copy of containers for one specific node: ``` Collections.unmodifiableSet(nodeToContainer.get(uuid)) ``` With this approach the users of the `nodeStateMap.getContainers` method couldn't modify the set anymore. But `nodeStateMap` can modify the original set which is referenced (instead of copy) by the `unmodifiableSet`. Even if it's unmodifiable it throws an exception during the iteration if the original set is modified in the background. ## How was this patch tested? There is a new unit test method which reproduce the specific race condition with the help of `CountDownLatch`-es ---------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
