hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [01/34] hadoop git commit: HADOOP-11459. Fix recent findbugs in ActiveStandbyElector, NetUtils and ShellBasedIdMapping (Contributed by Vinayakumar B)
Date Mon, 12 Jan 2015 18:18:43 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-EC e38cd055b -> 82c57eff9


HADOOP-11459. Fix recent findbugs in ActiveStandbyElector, NetUtils and ShellBasedIdMapping
(Contributed by Vinayakumar B)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1bd23bca
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1bd23bca
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1bd23bca

Branch: refs/heads/HDFS-EC
Commit: 1bd23bca447d50695d4ceda39749fdafbb39b968
Parents: 2b28125
Author: Vinayakumar B <vinayakumarb@apache.org>
Authored: Tue Jan 6 09:15:23 2015 +0530
Committer: Zhe Zhang <zhz@apache.org>
Committed: Mon Jan 12 10:17:58 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                 | 5 ++++-
 .../main/java/org/apache/hadoop/ha/ActiveStandbyElector.java    | 4 +++-
 .../src/main/java/org/apache/hadoop/net/NetUtils.java           | 2 +-
 .../java/org/apache/hadoop/security/ShellBasedIdMapping.java    | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1bd23bca/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 40e8d29..4ceb77d 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -670,7 +670,10 @@ Release 2.7.0 - UNRELEASED
 
     HADOOP-11446. S3AOutputStream should use shared thread pool to
     avoid OutOfMemoryError. (Ted Yu via stevel)	
-    
+
+    HADOOP-11459. Fix recent findbugs in ActiveStandbyElector, NetUtils
+    and ShellBasedIdMapping (vinayakumarb)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1bd23bca/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ActiveStandbyElector.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ActiveStandbyElector.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ActiveStandbyElector.java
index 123f119..947baa9 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ActiveStandbyElector.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ActiveStandbyElector.java
@@ -1064,7 +1064,9 @@ public class ActiveStandbyElector implements StatCallback, StringCallback
{
     public void process(WatchedEvent event) {
       hasReceivedEvent.countDown();
       try {
-        hasSetZooKeeper.await(zkSessionTimeout, TimeUnit.MILLISECONDS);
+        if (!hasSetZooKeeper.await(zkSessionTimeout, TimeUnit.MILLISECONDS)) {
+          LOG.debug("Event received with stale zk");
+        }
         ActiveStandbyElector.this.processWatchEvent(
             zk, event);
       } catch (Throwable t) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1bd23bca/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
index ffee402..ef1092b 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
@@ -288,7 +288,7 @@ public class NetUtils {
       try {
         fqHost = SecurityUtil.getByName(host).getHostName();
         // slight race condition, but won't hurt
-        canonicalizedHostCache.put(host, fqHost);
+        canonicalizedHostCache.putIfAbsent(host, fqHost);
       } catch (UnknownHostException e) {
         fqHost = host;
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1bd23bca/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
index 428e835..28ab248 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
@@ -290,7 +290,7 @@ public class ShellBasedIdMapping implements IdMappingServiceProvider {
     return true;
   }
 
-  private void initStaticMapping() throws IOException {
+  private synchronized void initStaticMapping() throws IOException {
     staticMapping = new StaticMapping(
         new HashMap<Integer, Integer>(), new HashMap<Integer, Integer>());
     if (staticMappingFile.exists()) {


Mime
View raw message