Description
NetgroupCache internally uses two ConcurrentHashMaps and a boolean variable to signal updates on one of the ConcurrentHashMap
None of the functions are synchronized and hence is possible to have unexpected results due to race condition between different threads.
As an example, consider the following sequence:
Thread1 :
add a group
netgroupToUsersMap is updated.
netgroupToUsersMapUpdated is set to true.
Thread 2:
calls getNetgroups for a user
Due to re-ordering, netgroupToUsersMapUpdated=true is visible, but updates in netgroupToUsersMap is not visible.
Does a wrong update with older netgroupToUsersMap values.
Attachments
Attachments
Issue Links
- relates to
-
HADOOP-11234 Potential thread unsafe in NetgroupCache
- Resolved
- requires
-
HADOOP-10851 NetgroupCache does not remove group memberships
- Closed