[ https://issues.apache.org/jira/browse/KAFKA-4041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547093#comment-16547093 ]
ASF GitHub Bot commented on KAFKA-4041: --------------------------------------- ijuma closed pull request #5376: KAFKA-4041: Update ZooKeeper to 3.4.13 URL: https://github.com/apache/kafka/pull/5376 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/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala b/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala index b402bf9e8ca..9f966b448b7 100755 --- a/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala +++ b/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala @@ -22,6 +22,7 @@ import kafka.utils.TestUtils._ import java.io.File import kafka.log.LogManager +import kafka.zookeeper.ZooKeeperClientTimeoutException import org.apache.kafka.clients.consumer.KafkaConsumer import org.apache.kafka.clients.producer.{KafkaProducer, ProducerRecord} import org.apache.kafka.common.errors.KafkaStorageException @@ -128,9 +129,10 @@ class ServerShutdownTest extends ZooKeeperTestHarness { @Test def testCleanShutdownAfterFailedStartup() { val newProps = TestUtils.createBrokerConfig(0, zkConnect) - newProps.setProperty("zookeeper.connect", "some.invalid.hostname.foo.bar.local:65535") + newProps.setProperty(KafkaConfig.ZkConnectionTimeoutMsProp, "50") + newProps.setProperty(KafkaConfig.ZkConnectProp, "some.invalid.hostname.foo.bar.local:65535") val newConfig = KafkaConfig.fromProps(newProps) - verifyCleanShutdownAfterFailedStartup[IllegalArgumentException](newConfig) + verifyCleanShutdownAfterFailedStartup[ZooKeeperClientTimeoutException](newConfig) } @Test @@ -175,23 +177,17 @@ class ServerShutdownTest extends ZooKeeperTestHarness { } def verifyNonDaemonThreadsStatus() { - assertEquals(0, Thread.getAllStackTraces.keySet().toArray - .map{ _.asInstanceOf[Thread] } + assertEquals(0, Thread.getAllStackTraces.keySet.toArray + .map(_.asInstanceOf[Thread]) .count(isNonDaemonKafkaThread)) } @Test def testConsecutiveShutdown(){ val server = new KafkaServer(config) - try { - server.startup() - server.shutdown() - server.awaitShutdown() - server.shutdown() - assertTrue(true) - } - catch{ - case _: Throwable => fail() - } + server.startup() + server.shutdown() + server.awaitShutdown() + server.shutdown() } } diff --git a/core/src/test/scala/unit/kafka/zookeeper/ZooKeeperClientTest.scala b/core/src/test/scala/unit/kafka/zookeeper/ZooKeeperClientTest.scala index c4143e2a8e6..fcbf699ec96 100644 --- a/core/src/test/scala/unit/kafka/zookeeper/ZooKeeperClientTest.scala +++ b/core/src/test/scala/unit/kafka/zookeeper/ZooKeeperClientTest.scala @@ -57,16 +57,16 @@ class ZooKeeperClientTest extends ZooKeeperTestHarness { System.clearProperty(JaasUtils.JAVA_LOGIN_CONFIG_PARAM) } - @Test(expected = classOf[IllegalArgumentException]) + @Test(expected = classOf[ZooKeeperClientTimeoutException]) def testUnresolvableConnectString(): Unit = { - new ZooKeeperClient("some.invalid.hostname.foo.bar.local", -1, -1, Int.MaxValue, time, "testMetricGroup", - "testMetricType").close() + new ZooKeeperClient("some.invalid.hostname.foo.bar.local", zkSessionTimeout, connectionTimeoutMs = 10, + Int.MaxValue, time, "testMetricGroup", "testMetricType").close() } @Test(expected = classOf[ZooKeeperClientTimeoutException]) def testConnectionTimeout(): Unit = { zookeeper.shutdown() - new ZooKeeperClient(zkConnect, zkSessionTimeout, connectionTimeoutMs = 100, Int.MaxValue, time, "testMetricGroup", + new ZooKeeperClient(zkConnect, zkSessionTimeout, connectionTimeoutMs = 10, Int.MaxValue, time, "testMetricGroup", "testMetricType").close() } diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 00aac028afe..fe1c744a79e 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -82,7 +82,7 @@ versions += [ slf4j: "1.7.25", snappy: "1.1.7.2", zkclient: "0.10", - zookeeper: "3.4.12" + zookeeper: "3.4.13" ] libs += [ ---------------------------------------------------------------- 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 > kafka unable to reconnect to zookeeper behind an ELB > ---------------------------------------------------- > > Key: KAFKA-4041 > URL: https://issues.apache.org/jira/browse/KAFKA-4041 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.9.0.1, 0.10.0.1 > Environment: RHEL EC2 instances > Reporter: prabhakar > Assignee: Ismael Juma > Priority: Blocker > Fix For: 1.1.2, 2.0.1, 2.1.0 > > > Kafka brokers are unable to connect to zookeeper which is behind an ELB. > Kafka is using zkClient which is caching the IP address of zookeeper and > even when there is a change in the IP for zookeeper it is using the Old > zookeeper IP. > The server.properties has a DNS name. Ideally kafka should resolve the IP > using the DNS in case of any failures connecting to the broker. -- This message was sent by Atlassian JIRA (v7.6.3#76005)