hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject svn commit: r1569387 - in /hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/security/token/Token.java
Date Tue, 18 Feb 2014 15:30:32 GMT
Author: jlowe
Date: Tue Feb 18 15:30:32 2014
New Revision: 1569387

URL: http://svn.apache.org/r1569387
Log:
svn merge -c 1569382 FIXES: HADOOP-10346. Deadlock while logging tokens. Contributed by Jason
Lowe

Modified:
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java

Modified: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1569387&r1=1569386&r2=1569387&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/CHANGES.txt Tue
Feb 18 15:30:32 2014
@@ -44,6 +44,8 @@ Release 2.4.0 - UNRELEASED
     HADOOP-10249. LdapGroupsMapping should trim ldap password read from file.
     (Dilli Armugam via suresh)
 
+    HADOOP-10346. Deadlock while logging tokens (jlowe)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java?rev=1569387&r1=1569386&r2=1569387&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java
(original)
+++ hadoop/common/branches/branch-2.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java
Tue Feb 18 15:30:32 2014
@@ -105,18 +105,21 @@ public class Token<T extends TokenIdenti
     return identifier;
   }
   
-  private static synchronized Class<? extends TokenIdentifier>
+  private static Class<? extends TokenIdentifier>
       getClassForIdentifier(Text kind) {
-    if (tokenKindMap == null) {
-      tokenKindMap = Maps.newHashMap();
-      for (TokenIdentifier id : ServiceLoader.load(TokenIdentifier.class)) {
-        tokenKindMap.put(id.getKind(), id.getClass());
+    Class<? extends TokenIdentifier> cls = null;
+    synchronized (Token.class) {
+      if (tokenKindMap == null) {
+        tokenKindMap = Maps.newHashMap();
+        for (TokenIdentifier id : ServiceLoader.load(TokenIdentifier.class)) {
+          tokenKindMap.put(id.getKind(), id.getClass());
+        }
       }
+      cls = tokenKindMap.get(kind);
     }
-    Class<? extends TokenIdentifier> cls = tokenKindMap.get(kind);
     if (cls == null) {
       LOG.warn("Cannot find class for token kind " + kind);
-       return null;
+      return null;
     }
     return cls;
   }



Mime
View raw message