Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C503D7D5 for ; Wed, 5 Sep 2012 22:58:10 +0000 (UTC) Received: (qmail 32854 invoked by uid 500); 5 Sep 2012 22:58:10 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 32807 invoked by uid 500); 5 Sep 2012 22:58:10 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 32750 invoked by uid 99); 5 Sep 2012 22:58:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 22:58:10 +0000 Date: Thu, 6 Sep 2012 09:58:10 +1100 (NCT) From: "Chris Trezzo (JIRA)" To: issues@hbase.apache.org Message-ID: <958325202.41797.1346885890278.JavaMail.jiratomcat@arcas> In-Reply-To: <375583729.24285.1324218270672.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (HBASE-5065) wrong IllegalArgumentException thrown when creating an 'HServerAddress' with an un-reachable hostname 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/HBASE-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Trezzo resolved HBASE-5065. --------------------------------- Resolution: Invalid This looks like it is now fixed in trunk and 0.90. checkBindAddressCanBeResolved() now has a null check and throws an IllegalArgumentException with an appropriate message. This class is also deprecated. Please reopen if you think differently. > wrong IllegalArgumentException thrown when creating an 'HServerAddress' with an un-reachable hostname > ----------------------------------------------------------------------------------------------------- > > Key: HBASE-5065 > URL: https://issues.apache.org/jira/browse/HBASE-5065 > Project: HBase > Issue Type: Bug > Components: util > Affects Versions: 0.90.4 > Reporter: Eran Hirsch > Priority: Trivial > > When trying to build an 'HServerAddress' object with an unresolvable hostname: > e.g. new HServerAddress("www.IAMUNREACHABLE.com:80") > a call to 'getResolvedAddress' would cause the 'InetSocketAddress' c'tor to throw an IllegalArgumentException because it is called with a null 'hostname' parameter. > This happens because there is no null-check after the static 'getBindAddressInternal' method returns a null value when the hostname is unresolved. > This is a trivial bug because the code HServerAddress is expected to throw this kind of exception when this error occurs, but it is thrown "for the wrong reason". The method 'checkBindAddressCanBeResolved' should be the one throwing the exception (and give a slightly different reason). Because of this reason the method call itself becomes redundent as it will always succeed in the current flow, because the case it checks is already "checked" for by the previous "getResolvedAddress" method. > In short: > an IllegalArgumentException is thrown with reason: "hostname can't be null" from the InetSocketAddress c'tor > INSTEAD OF > an IllegalArgumentException with reason: "Could not resolve the DNS name of [BADHOSTNAME]:[PORT]" from HServerAddress's checkBindCanBeResolved method. > Stack trace: > java.lang.IllegalArgumentException: hostname can't be null > at java.net.InetSocketAddress.(InetSocketAddress.java:139) ~[na:1.7.0_02] > at org.apache.hadoop.hbase.HServerAddress.getResolvedAddress(HServerAddress.java:108) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.HServerAddress.(HServerAddress.java:64) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.zookeeper.RootRegionTracker.dataToHServerAddress(RootRegionTracker.java:82) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.zookeeper.RootRegionTracker.waitRootRegionLocation(RootRegionTracker.java:73) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:579) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:559) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:688) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:590) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:559) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:688) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:594) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:559) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HTable.(HTable.java:173) ~[hbase-0.90.4.jar:0.90.4] > at org.apache.hadoop.hbase.client.HTable.(HTable.java:147) ~[hbase-0.90.4.jar:0.90.4] -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira