Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-95

UnknownHostException if the system can't determine its own name and you go DNS.getIPs("name-of-an-unknown-interface");

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.21.0
    • None
    • None

    Description

      If you give an interface that doesnt exist, DNS.getIPs falls back to
      InetAddress.getLocalHost().getHostAddress()

      But there's an assumption there: that InetAddress.getLocalHost(). is valid. If it doesnt resolve properly, you get an UnknownHostException

      java.net.UnknownHostException: k2: k2
      at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
      at org.apache.hadoop.net.DNS.getIPs(DNS.java:96)
      at org.apache.hadoop.net.TestDNS.testIPsOfUnknownInterface(TestDNS.java:73)

      It is possible to catch this and return something else. The big question: what to fall back to? 127.0.0.1 would be an obvious choice

      Attachments

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: