amahussein opened a new pull request #2627:
URL: https://github.com/apache/hadoop/pull/2627


   - `cacheGroupsRefresh` introduces a race that could result in a group not 
being added correctly to the set of keys in the table. The code below shows 
that a concurrent thread that adds a group between lines 80-81 would not be 
accounted for.  
   
   ```java
   78 @Override
   79  public void cacheGroupsRefresh() throws IOException {
   80    List<String> groups = NetgroupCache.getNetgroupNames();
   81     NetgroupCache.clear();
   82    cacheGroupsAdd(groups);
   83  }
   ```
   - getGroupSet is not implemented in JNIBased classes. As a result, the 
netgroup  data won't be retrieved from the NetgroupCache even after forcing a 
manual `refresh()`. This bug was introduced by 
[HADOOP-17079](https://issues.apache.org/jira/browse/HADOOP-17079)
   - `NetgroupCache.isCached` is not threadSafe. The process of checking 
whether a group has been cached or not can be overwhelming given the number of 
users in the tables.
   - In addition to the above fixed, I added a unit test to verify the code 
fails in concurrent environment.


----------------------------------------------------------------
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]

Reply via email to