Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12C3D176E1 for ; Sat, 7 Feb 2015 19:15:36 +0000 (UTC) Received: (qmail 74776 invoked by uid 500); 7 Feb 2015 19:15:35 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 74727 invoked by uid 500); 7 Feb 2015 19:15:35 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 74715 invoked by uid 99); 7 Feb 2015 19:15:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2015 19:15:35 +0000 Date: Sat, 7 Feb 2015 19:15:35 +0000 (UTC) From: "Steve Loughran (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-3619) DNS.getHosts triggers an ArrayIndexOutOfBoundsException in reverseDNS if one of the interfaces is IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-3619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14310878#comment-14310878 ] Steve Loughran commented on HADOOP-3619: ---------------------------------------- -1 as is, though with a couple of iterations it should be ready to go in. h3. production code # no need to explicitly use {{java.net.Inet4Address}} & {{java.net.Inet6Address}}; they are imported & can be used directly. # recommend: the naming exception to include a link to new hadoop wiki entry (ideally https://wiki.apache.org/hadoop/DNS) which we can expand to cover DNS issues for those users who don't know anything about them. # the new ipv4/ipv6 methods should be private. # {{getNibbleFromAddress()}} should be package scoped, tagged {{@VisibleForTesting}}, and have a test which that the example result comes from the example input. Given that there's no way to create a stub IPv6 address, the bytes->string generation logic could be pulled out and tested standalone. h3. Test case # {{assertEquals()}} comparators are inverted: expected value comes first. # We can't have tests that expect the external network to be there, not even DNS. Is there a way to test this such that only localhost DNS lookup is needed? # what happens to these tests on machines without IPv6 support? It's not directly a test failure, just a machine/network configuration. The test needs to recognise and handle this situation. General * hadoop style guide is 2 chars, no tabs, amongst other things. see https://github.com/steveloughran/formality/blob/master/styleguide/styleguide.md for a side project of mine to document what is generally expected. > DNS.getHosts triggers an ArrayIndexOutOfBoundsException in reverseDNS if one of the interfaces is IPv6 > ------------------------------------------------------------------------------------------------------ > > Key: HADOOP-3619 > URL: https://issues.apache.org/jira/browse/HADOOP-3619 > Project: Hadoop Common > Issue Type: Bug > Components: net > Reporter: Steve Loughran > Assignee: Dr. Martin Menzel > Labels: ipv6, patch > Attachments: HADOOP-3619-v2.patch > > > reverseDNS tries to split a host address string by ".", and so fails if ":" is the separator, as it is in IPv6. When it tries to access the parts of the address, a stack trace is seen. -- This message was sent by Atlassian JIRA (v6.3.4#6332)