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 CDA41200BFC for ; Sat, 14 Jan 2017 23:35:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CC60E160B51; Sat, 14 Jan 2017 22:35:30 +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 2ABE1160B2D for ; Sat, 14 Jan 2017 23:35:30 +0100 (CET) Received: (qmail 79457 invoked by uid 500); 14 Jan 2017 22:35:29 -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 79445 invoked by uid 99); 14 Jan 2017 22:35:29 -0000 Received: from Unknown (HELO jira-lw-us.apache.org) (207.244.88.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2017 22:35:29 +0000 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 891FB25290 for ; Sat, 14 Jan 2017 22:35:26 +0000 (UTC) Date: Sat, 14 Jan 2017 22:35:26 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2184) Zookeeper Client should re-resolve hosts when connection attempts fail MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 14 Jan 2017 22:35:31 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15822976#comment-15822976 ] ASF GitHub Bot commented on ZOOKEEPER-2184: ------------------------------------------- Github user fpj commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/150#discussion_r96125997 --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java --- @@ -45,6 +45,9 @@ private int currentIndex = -1; + // Don't re-resolve on first next() call + private boolean connectedSinceNext = true; --- End diff -- All calls to `next` and `onConnected` are from the `sendThread`. I don't see a reason for making volatile, unless we are doing it defensively. Let me know if I'm missing anything. Note that this pull request is for the 3.4 branch, we need a different patch for 3.5 and master. > Zookeeper Client should re-resolve hosts when connection attempts fail > ---------------------------------------------------------------------- > > Key: ZOOKEEPER-2184 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2184 > Project: ZooKeeper > Issue Type: Bug > Components: java client > Affects Versions: 3.4.6, 3.5.0 > Environment: Ubuntu 14.04 host, Docker containers for Zookeeper & Kafka > Reporter: Robert P. Thille > Assignee: Robert P. Thille > Labels: easyfix, patch > Fix For: 3.4.10, 3.5.3 > > Attachments: ZOOKEEPER-2184.patch > > > Testing in a Docker environment with a single Kafka instance using a single Zookeeper instance. Restarting the Zookeeper container will cause it to receive a new IP address. Kafka will never be able to reconnect to Zookeeper and will hang indefinitely. Updating DNS or /etc/hosts with the new IP address will not help the client to reconnect as the zookeeper/client/StaticHostProvider resolves the connection string hosts at creation time and never re-resolves. > A solution would be for the client to notice that connection attempts fail and attempt to re-resolve the hostnames in the connectString. -- This message was sent by Atlassian JIRA (v6.3.4#6332)