From e58355f9aac1323edbab06e54891309553337cb3 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Fri, 13 Jun 2014 16:52:00 +0000 Subject: [PATCH] HADOOP-10678. Merging change r1602473 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1602474 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-common/CHANGES.txt | 3 +++ .../apache/hadoop/security/SecurityUtil.java | 22 ++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index ca7964ca219..db0526ce709 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -208,6 +208,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10686. Writables are not always configured. (Abraham Elmahrek via kasha) + HADOOP-10678. SecurityUtil has unnecessary synchronization on collection + used for only tests. (Benoy Antony via cnauroth) + BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS HADOOP-10520. Extended attributes definition and FileSystem APIs for diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java index 623c3ebbdfb..b71fbda6301 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java @@ -289,12 +289,10 @@ public class SecurityUtil { */ public static KerberosInfo getKerberosInfo(Class protocol, Configuration conf) { - synchronized (testProviders) { - for(SecurityInfo provider: testProviders) { - KerberosInfo result = provider.getKerberosInfo(protocol, conf); - if (result != null) { - return result; - } + for(SecurityInfo provider: testProviders) { + KerberosInfo result = provider.getKerberosInfo(protocol, conf); + if (result != null) { + return result; } } @@ -317,13 +315,11 @@ public class SecurityUtil { * @return the TokenInfo or null if it has no KerberosInfo defined */ public static TokenInfo getTokenInfo(Class protocol, Configuration conf) { - synchronized (testProviders) { - for(SecurityInfo provider: testProviders) { - TokenInfo result = provider.getTokenInfo(protocol, conf); - if (result != null) { - return result; - } - } + for(SecurityInfo provider: testProviders) { + TokenInfo result = provider.getTokenInfo(protocol, conf); + if (result != null) { + return result; + } } synchronized (securityInfoProviders) {