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:
add a group
netgroupToUsersMap is updated.
netgroupToUsersMapUpdated is set to true.
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.