hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1239356 - in /hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs: CHANGES.HDFS-1623.txt src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
Date Wed, 01 Feb 2012 22:02:29 GMT
Author: todd
Date: Wed Feb  1 22:02:29 2012
New Revision: 1239356

URL: http://svn.apache.org/viewvc?rev=1239356&view=rev
Log:
HDFS-2859. LOCAL_ADDRESS_MATCHER.match has NPE when called from DFSUtil.getSuffixIDs when
the host is incorrect. Contributed by Bikas Saha.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt?rev=1239356&r1=1239355&r2=1239356&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
Wed Feb  1 22:02:29 2012
@@ -149,3 +149,5 @@ HDFS-2845. SBN should not allow browsing
 HDFS-2742. HA: observed dataloss in replication stress test. (todd via eli)
 
 HDFS-2870. Fix log level for block debug info in processMisReplicatedBlocks (todd)
+
+HDFS-2859. LOCAL_ADDRESS_MATCHER.match has NPE when called from DFSUtil.getSuffixIDs when
the host is incorrect (Bikas Saha via todd)

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java?rev=1239356&r1=1239355&r2=1239356&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java
Wed Feb  1 22:02:29 2012
@@ -61,6 +61,8 @@ import org.apache.hadoop.ipc.RpcPayloadH
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.net.NodeBase;
 import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import com.google.common.base.Joiner;
 import com.google.common.collect.Lists;
@@ -69,6 +71,8 @@ import com.google.protobuf.BlockingServi
 
 @InterfaceAudience.Private
 public class DFSUtil {
+  private static final Log LOG = LogFactory.getLog(DFSUtil.class.getName());
+  
   private DFSUtil() { /* Hidden constructor */ }
   private static final ThreadLocal<Random> RANDOM = new ThreadLocal<Random>()
{
     @Override
@@ -935,9 +939,10 @@ public class DFSUtil {
         try {
           s = NetUtils.createSocketAddr(addr);
         } catch (Exception e) {
+          LOG.warn("Exception in creating socket address", e);
           continue;
         }
-        if (matcher.match(s)) {
+        if (!s.isUnresolved() && matcher.match(s)) {
           nameserviceId = nsId;
           namenodeId = nnId;
           found++;



Mime
View raw message