[ https://issues.apache.org/jira/browse/KAFKA-7193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16553191#comment-16553191 ]
ASF GitHub Bot commented on KAFKA-7193: --------------------------------------- rajinisivaram closed pull request #5414: KAFKA-7193: Use ZooKeeper IP address in streams tests to avoid timeouts URL: https://github.com/apache/kafka/pull/5414 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/docs/upgrade.html b/docs/upgrade.html index c9c0c90e003..ccfab95897f 100644 --- a/docs/upgrade.html +++ b/docs/upgrade.html @@ -147,6 +147,9 @@ <h5><a id="upgrade_200_notable" href="#upgrade_200_notable">Notable changes in 2 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 daa1103789b..6239a681961 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 @@ private void stop() { * 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(); } /** ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > ZooKeeper client times out with localhost due to random choice of ipv4/ipv6 > --------------------------------------------------------------------------- > > Key: KAFKA-7193 > URL: https://issues.apache.org/jira/browse/KAFKA-7193 > Project: Kafka > Issue Type: Bug > Components: zkclient > Affects Versions: 2.0.0 > Reporter: Rajini Sivaram > Assignee: Rajini Sivaram > Priority: Major > > 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. > With the default 6 second connection timeout in Kafka, this can result in > client connection failures if ipv6 is chosen in consecutive address > selections. > Streams tests are failing intermittently as a result of this. -- This message was sent by Atlassian JIRA (v7.6.3#76005)