You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/01/12 08:30:37 UTC
[GitHub] [ozone] elek opened a new pull request #1782: NodeStateMap leaks internal representation of container sets
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] nandakumar131 commented on pull request #1782: HDDS-4673. NodeStateMap leaks internal representation of container sets
Posted by GitBox <gi...@apache.org>.
nandakumar131 commented on pull request #1782:
URL: https://github.com/apache/ozone/pull/1782#issuecomment-758798502
Thanks @elek for taking care of this.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] nandakumar131 merged pull request #1782: HDDS-4673. NodeStateMap leaks internal representation of container sets
Posted by GitBox <gi...@apache.org>.
nandakumar131 merged pull request #1782:
URL: https://github.com/apache/ozone/pull/1782
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org