From dev-return-70442-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Sat Jun 9 07:46:54 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 11C9C180648 for ; Sat, 9 Jun 2018 07:46:53 +0200 (CEST) Received: (qmail 56747 invoked by uid 500); 9 Jun 2018 05:46:48 -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 56736 invoked by uid 99); 9 Jun 2018 05:46:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Jun 2018 05:46:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D16DBE1107; Sat, 9 Jun 2018 05:46:46 +0000 (UTC) From: lvfangmin To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #534: ZOOKEEPER-2184 Zookeeper Client should re-resol... Content-Type: text/plain Message-Id: <20180609054646.D16DBE1107@git1-us-west.apache.org> Date: Sat, 9 Jun 2018 05:46:46 +0000 (UTC) Github user lvfangmin commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/534#discussion_r194215559 --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java --- @@ -149,15 +185,12 @@ public StaticHostProvider(Collection serverAddresses, * @param currentHost the host to which this client is currently connected * @return true if changing connections is necessary for load-balancing, false otherwise */ - - @Override public synchronized boolean updateServerList( Collection serverAddresses, InetSocketAddress currentHost) { - // Resolve server addresses and shuffle them - List resolvedList = resolveAndShuffle(serverAddresses); - if (resolvedList.isEmpty()) { + List shuffledList = shuffle(serverAddresses); --- End diff -- After this change, the old / new server list both contains unresolved address, so it's comparable, but it's meaningless to compare addr.getAddress because it will return null when it's unresolved. ---