Browse Source

MINOR: Close ZKDatabase in EmbeddedZookeeper (#6237)

And remove redundant call. Closing ZKDatabase is necessary to allow the data
directory to be deleted when running on Windows.

Reviewers: Ismael Juma <ismael@juma.me.uk>
pull/7129/head
Arlo Louis O'Keeffe 5 years ago committed by Ismael Juma
parent
commit
9ad7bce492
  1. 3
      core/src/test/scala/unit/kafka/zk/EmbeddedZookeeper.scala

3
core/src/test/scala/unit/kafka/zk/EmbeddedZookeeper.scala

@ -49,7 +49,7 @@ class EmbeddedZookeeper() extends Logging { @@ -49,7 +49,7 @@ class EmbeddedZookeeper() extends Logging {
val port = zookeeper.getClientPort
def shutdown(): Unit = {
CoreUtils.swallow(zookeeper.shutdown(), this)
// Also shuts down ZooKeeperServer
CoreUtils.swallow(factory.shutdown(), this)
def isDown(): Boolean = {
@ -60,6 +60,7 @@ class EmbeddedZookeeper() extends Logging { @@ -60,6 +60,7 @@ class EmbeddedZookeeper() extends Logging {
}
Iterator.continually(isDown()).exists(identity)
CoreUtils.swallow(zookeeper.getZKDatabase().close(), this)
Utils.delete(logDir)
Utils.delete(snapshotDir)

Loading…
Cancel
Save