kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsiva...@apache.org
Subject [kafka] branch trunk updated: KAFKA-7193: Use ZooKeeper IP address in streams tests to avoid timeouts (#5414)
Date Mon, 23 Jul 2018 18:10:39 GMT
This is an automated email from the ASF dual-hosted git repository.

rsivaram pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git

The following commit(s) were added to refs/heads/trunk by this push:
     new 4b60ed3  KAFKA-7193: Use ZooKeeper IP address in streams tests to avoid timeouts
4b60ed3 is described below

commit 4b60ed3247f0931731904c49dc7381b8eaac88d8
Author: Rajini Sivaram <rajinisivaram@googlemail.com>
AuthorDate: Mon Jul 23 19:10:33 2018 +0100

    KAFKA-7193: Use ZooKeeper IP address in streams tests to avoid timeouts (#5414)
    ZooKeeper client from version 3.4.13 doesn't handle connections to localhost very well.
If ZooKeeper is started on on a machine that has both ipv4 and ipv6 and a client
is created using localhost rather than the IP address in the connection string, ZooKeeper
client attempts to connect to ipv4 or ipv6 randomly with a fixed one second backoff if connection
fails. Use instead of localhost in streams tests to avoid intermittent test failures
due to ZK client connection [...]
    Reviewers: Ismael Juma <github@juma.me.uk>, Matthias J. Sax <matthias@confluent.io>
 docs/upgrade.html                                                      | 3 +++
 .../apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/upgrade.html b/docs/upgrade.html
index c9c0c90..ccfab95 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -147,6 +147,9 @@
        error to the client.</p></li>
     <li>Dynamic broker configuration options can be stored in ZooKeeper using kafka-configs.sh
before brokers are started.
         This option can be used to avoid storing clear passwords in server.properties as
all password configs may be stored encrypted in ZooKeeper.</li>
+    <li>ZooKeeper hosts are now re-resolved if connection attempt fails. But if your
ZooKeeper host names resolve
+    to multiple addresses and some of them are not reachable, then you may need to increase
the connection timeout
+    <code>zookeeper.connection.timeout.ms</code>.</li>
 <h5><a id="upgrade_200_new_protocols" href="#upgrade_200_new_protocols">New Protocol
diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java
index daa1103..6239a68 100644
--- a/streams/src/test/java/org/apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java
+++ b/streams/src/test/java/org/apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java
@@ -128,7 +128,7 @@ public class EmbeddedKafkaCluster extends ExternalResource {
      * You can use this to e.g. tell Kafka brokers how to connect to this instance.
     public String zKConnectString() {
-        return "localhost:" + zookeeper.port();
+        return "" + zookeeper.port();

View raw message