This is an automated email from the ASF dual-hosted git repository.
rsivaram pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.0 by this push:
new 21b72b9 KAFKA-7193: Use ZooKeeper IP address in streams tests to
avoid timeouts (#5414)
21b72b9 is described below
commit 21b72b96a5359ef6bf2b1bfb2fcd3cecfbf41277
Author: Rajini Sivaram <[email protected]>
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 127.0.0.1 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
127.0.0.1 instead of localhost in streams tests to avoid intermittent test
failures due to ZK client connection [...]
Reviewers: Ismael Juma <[email protected]>, Matthias J. Sax
<[email protected]>
---
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 00fe133..6fd0d2c 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -133,6 +133,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>
</ul>
<h5><a id="upgrade_200_new_protocols" href="#upgrade_200_new_protocols">New
Protocol Versions</a></h5>
diff --git
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
index 3ea365c..ce6324d 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
@@ -137,7 +137,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 "127.0.0.1:" + zookeeper.port();
}
/**