You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Kihwal Lee (JIRA)" <ji...@apache.org> on 2013/03/18 23:13:15 UTC
[jira] [Commented] (HADOOP-9200) enhance unit-test coverage of
class org.apache.hadoop.security.NetgroupCache
[ https://issues.apache.org/jira/browse/HADOOP-9200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605728#comment-13605728 ]
Kihwal Lee commented on HADOOP-9200:
------------------------------------
Review comments:
* TestNetGroupCaching.java : it needs the license header
* A change made in NetgroupCache.java may expose a new problem. Details follow.
* Don't forget to add a timeout to the test cases that are new or modified.
{code}
@@ -102,6 +102,8 @@
*/
public static void clear() {
netgroupToUsersMap.clear();
+ netgroupToUsersMapUpdated = true;
+ userToNetgroupsMap.clear();
}
/**
{code}
In the current code, netgroupToUsersMap is not cleared, so a user's loss of membership to a group or removal of a user will not take effect. So above change seems necessary. But since refresh() is not atomic, requests made during rebuilding of the data structures may incorrectly result in an access violation. We could make cacheGroupsRefresh() and calls to NetgroupCache.getNetgroups() synchronized to solve this problem, but it will be better if refresh happens in background and the new mapping is swapped in as a last step of refresh, so that getGroups() calls are not blocked while refresh is going on.
> enhance unit-test coverage of class org.apache.hadoop.security.NetgroupCache
> ----------------------------------------------------------------------------
>
> Key: HADOOP-9200
> URL: https://issues.apache.org/jira/browse/HADOOP-9200
> Project: Hadoop Common
> Issue Type: Test
> Affects Versions: 3.0.0, 2.0.3-alpha, 0.23.6
> Reporter: Ivan A. Veselovsky
> Assignee: Ivan A. Veselovsky
> Attachments: HADOOP-9200-trunk.patch
>
>
> The class org.apache.hadoop.security.NetgroupCache has poor unit-test coverage. Enhance it.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira