Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 362912005E6 for ; Sun, 30 Jul 2017 18:28:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3481F1641B9; Sun, 30 Jul 2017 16:28:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 794C81641B6 for ; Sun, 30 Jul 2017 18:28:10 +0200 (CEST) Received: (qmail 56838 invoked by uid 500); 30 Jul 2017 16:28:09 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 56827 invoked by uid 99); 30 Jul 2017 16:28:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jul 2017 16:28:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 126EFC0042 for ; Sun, 30 Jul 2017 16:28:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.502 X-Spam-Level: X-Spam-Status: No, score=-99.502 tagged_above=-999 required=6.31 tests=[KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id dHcXJBLzQ2WC for ; Sun, 30 Jul 2017 16:28:08 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A66295F6C2 for ; Sun, 30 Jul 2017 16:28:07 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E5E27E0DDB for ; Sun, 30 Jul 2017 16:28:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7308A24655 for ; Sun, 30 Jul 2017 16:28:02 +0000 (UTC) Date: Sun, 30 Jul 2017 16:28:02 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2614) Port ZOOKEEPER-1576 to branch3.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 30 Jul 2017 16:28:11 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16106544#comment-16106544 ] ASF GitHub Bot commented on ZOOKEEPER-2614: ------------------------------------------- Github user hanm commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/320#discussion_r130246293 --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java --- @@ -52,34 +52,36 @@ * * @param serverAddresses * possibly unresolved ZooKeeper server addresses - * @throws UnknownHostException * @throws IllegalArgumentException * if serverAddresses is empty or resolves to an empty list */ - public StaticHostProvider(Collection serverAddresses) - throws UnknownHostException { + public StaticHostProvider(Collection serverAddresses) { for (InetSocketAddress address : serverAddresses) { - InetAddress ia = address.getAddress(); - InetAddress resolvedAddresses[] = InetAddress.getAllByName((ia!=null) ? ia.getHostAddress(): - address.getHostName()); - for (InetAddress resolvedAddress : resolvedAddresses) { - // If hostName is null but the address is not, we can tell that - // the hostName is an literal IP address. Then we can set the host string as the hostname - // safely to avoid reverse DNS lookup. - // As far as i know, the only way to check if the hostName is null is use toString(). - // Both the two implementations of InetAddress are final class, so we can trust the return value of - // the toString() method. - if (resolvedAddress.toString().startsWith("/") - && resolvedAddress.getAddress() != null) { - this.serverAddresses.add( - new InetSocketAddress(InetAddress.getByAddress( - address.getHostName(), - resolvedAddress.getAddress()), - address.getPort())); - } else { - this.serverAddresses.add(new InetSocketAddress(resolvedAddress.getHostAddress(), address.getPort())); - } - } + try { --- End diff -- Indentation here is a little bit off. 4 spaces instead of 8. Please update. Other than this patch looks good. > Port ZOOKEEPER-1576 to branch3.4 > -------------------------------- > > Key: ZOOKEEPER-2614 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2614 > Project: ZooKeeper > Issue Type: Bug > Affects Versions: 3.4.9 > Reporter: Vishal Khandelwal > Assignee: Vishal Khandelwal > Fix For: 3.4.11 > > Attachments: ZOOKEEPER-2614.branch-3.4.00.patch > > > ZOOKEEPER-1576 handles UnknownHostException and it good to have this change for 3.4 branch as well. Porting the changes to 3.4 after resolving the conflicts -- This message was sent by Atlassian JIRA (v6.4.14#64029)