Explorar el Código

HADOOP-7854. UGI getCurrentUser is not synchronized. Contributed by Daryn Sharp.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security@1206427 13f79535-47bb-0310-9956-ffa450edef68
Jitendra Nath Pandey hace 13 años
padre
commit
b948b5e490
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 2 0
      CHANGES.txt
  2. 2 1
      src/core/org/apache/hadoop/security/UserGroupInformation.java

+ 2 - 0
CHANGES.txt

@@ -225,6 +225,8 @@ Release 0.20.205.1 - unreleased
 
     HDFS-2590. Fix the missing links in the WebHDFS forrest doc.  (szetszwo)
 
+    HDFS-7854. UGI getCurrentUser is not synchronized. (Daryn Sharp via jitendra)
+
 Release 0.20.205.0 - 2011.10.06
 
   NEW FEATURES

+ 2 - 1
src/core/org/apache/hadoop/security/UserGroupInformation.java

@@ -407,7 +407,8 @@ public class UserGroupInformation {
    * @return the current user
    * @throws IOException if login fails
    */
-  public static UserGroupInformation getCurrentUser() throws IOException {
+  public synchronized
+  static UserGroupInformation getCurrentUser() throws IOException {
     AccessControlContext context = AccessController.getContext();
     Subject subject = Subject.getSubject(context);
     return subject == null ? getLoginUser() : new UserGroupInformation(subject);