Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
UserGroupInformation#ensureInitialized() uses the double-check-locking pattern to reduce the synchronization cost:
private static void ensureInitialized() { if (conf == null) { synchronized(UserGroupInformation.class) { if (conf == null) { // someone might have beat us initialize(new Configuration(), false); } } } }
As tlipcon pointed out in the original jira (HADOOP-9748). This pattern is incorrect. Please see more details in http://en.wikipedia.org/wiki/Double-checked_locking and http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
This jira proposes to use the static class holder pattern to do it correctly.
Attachments
Issue Links
- is broken by
-
HADOOP-9748 Reduce blocking on UGI.ensureInitialized
- Closed