Hadoop Common
  1. Hadoop Common
  2. HADOOP-9099

NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 1-win
    • Fix Version/s: 1.2.0, 3.0.0, 1-win
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Target Version/s:

      Description

      I just hit this failure. We should use some more unique string for "UnknownHost":

      Testcase: testNormalizeHostName took 0.007 sec
      FAILED
      expected:<[65.53.5.181]> but was:<[UnknownHost]>
      junit.framework.AssertionFailedError: expected:<[65.53.5.181]> but was:<[UnknownHost]>
      at org.apache.hadoop.net.TestNetUtils.testNormalizeHostName(TestNetUtils.java:347)

      Will post a patch in a bit.

      1. HADOOP-9099.branch-1-win.patch
        0.7 kB
        Ivan Mitic
      2. HADOOP-9099.trunk.patch
        0.8 kB
        Ivan Mitic

        Activity

        Hide
        Ivan Mitic added a comment -

        Attaching the patch.

        Show
        Ivan Mitic added a comment - Attaching the patch.
        Hide
        Mostafa Elhemali added a comment -

        Personally I would've used something even more unlikely, such as "ThisIsNotARealHostName-ItJustCant", but I guess UnknownHost123 is not very likely to exist .

        +1 (non-binding).

        Show
        Mostafa Elhemali added a comment - Personally I would've used something even more unlikely, such as "ThisIsNotARealHostName-ItJustCant", but I guess UnknownHost123 is not very likely to exist . +1 (non-binding).
        Hide
        Tsz Wo Nicholas Sze added a comment -

        TestNetUtils in branch-1-win does not fail in my machine. Is there any special setting in your machine/network?

        BTW, I just have a quick check of the InetAddress source code (http://www.docjar.com/html/api/java/net/InetAddress.java.html). It seems that it won't do any lookup if the input string is already an numerical IP address. However, it is probably jdk dependent.

        Show
        Tsz Wo Nicholas Sze added a comment - TestNetUtils in branch-1-win does not fail in my machine. Is there any special setting in your machine/network? BTW, I just have a quick check of the InetAddress source code ( http://www.docjar.com/html/api/java/net/InetAddress.java.html ). It seems that it won't do any lookup if the input string is already an numerical IP address. However, it is probably jdk dependent.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I understand the problem after looked at Ivan's patch - "UnknownHost" was resolved to an IP in your setting.

        Show
        Tsz Wo Nicholas Sze added a comment - I understand the problem after looked at Ivan's patch - "UnknownHost" was resolved to an IP in your setting.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed this. Thanks, Ivan!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this. Thanks, Ivan!
        Hide
        Ivan Mitic added a comment -

        Thanks Mostafa and Nicholas for the review!

        Show
        Ivan Mitic added a comment - Thanks Mostafa and Nicholas for the review!
        Hide
        Ivan Mitic added a comment -

        Run into the same failure in trunk (branch-trunk-win). Attaching the trunk compatible patch.

        Nicholas, can we please commit this to trunk as well?

        Show
        Ivan Mitic added a comment - Run into the same failure in trunk (branch-trunk-win). Attaching the trunk compatible patch. Nicholas, can we please commit this to trunk as well?
        Hide
        Ivan Mitic added a comment -

        Reopening for trunk.

        Show
        Ivan Mitic added a comment - Reopening for trunk.
        Hide
        Suresh Srinivas added a comment -

        Ivan, your thinking pattern will influence someone to use UnknownHost123 I am sure this jira will be opened many more times to come up with creative non existent host names

        +1 for the patch. Will commit it after Jenkins posts +1.

        Show
        Suresh Srinivas added a comment - Ivan, your thinking pattern will influence someone to use UnknownHost123 I am sure this jira will be opened many more times to come up with creative non existent host names +1 for the patch. Will commit it after Jenkins posts +1.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12572041/HADOOP-9099.trunk.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 tests included appear to have a timeout.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-common.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/2292//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2292//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12572041/HADOOP-9099.trunk.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 tests included appear to have a timeout. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-common. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/2292//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2292//console This message is automatically generated.
        Hide
        Suresh Srinivas added a comment -

        I committed the patch to trunk. Thank you Ivan.

        Show
        Suresh Srinivas added a comment - I committed the patch to trunk. Thank you Ivan.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-trunk-Commit #3452 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3452/)
        HADOOP-9099. NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Show
        Hudson added a comment - Integrated in Hadoop-trunk-Commit #3452 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3452/ ) HADOOP-9099 . NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Yarn-trunk #154 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/154/)
        HADOOP-9099. NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Show
        Hudson added a comment - Integrated in Hadoop-Yarn-trunk #154 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/154/ ) HADOOP-9099 . NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1343 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1343/)
        HADOOP-9099. NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1343 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1343/ ) HADOOP-9099 . NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1371 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1371/)
        HADOOP-9099. NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1371 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1371/ ) HADOOP-9099 . NetUtils.normalizeHostName fails on domains where UnknownHost resolves to an IP address. Contributed by Ivan Mitic. (Revision 1455629) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455629 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java
        Hide
        Matt Foley added a comment -

        Closed upon release of Hadoop 1.2.0.

        Show
        Matt Foley added a comment - Closed upon release of Hadoop 1.2.0.

          People

          • Assignee:
            Ivan Mitic
            Reporter:
            Ivan Mitic
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development