Browse Source

KafkaServer can throw a NullPointerException during startup if zookeeper is down; KAFKA-94

git-svn-id: https://svn.apache.org/repos/asf/incubator/kafka/trunk@1156940 13f79535-47bb-0310-9956-ffa450edef68
0.7.0
Jun Rao 13 years ago
parent
commit
944da579ba
  1. 6
      core/src/main/scala/kafka/server/KafkaServer.scala

6
core/src/main/scala/kafka/server/KafkaServer.scala

@ -96,9 +96,11 @@ class KafkaServer(val config: KafkaConfig) { @@ -96,9 +96,11 @@ class KafkaServer(val config: KafkaConfig) {
logger.info("Shutting down...")
try {
scheduler.shutdown
socketServer.shutdown()
if (socketServer != null)
socketServer.shutdown()
Utils.swallow(logger.warn, Utils.unregisterMBean(statsMBeanName))
logManager.close()
if (logManager != null)
logManager.close()
val cleanShutDownFile = new File(new File(config.logDir), CLEAN_SHUTDOWN_FILE)
cleanShutDownFile.createNewFile

Loading…
Cancel
Save