This is an automated email from the ASF dual-hosted git repository.
ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1918f5c MINOR: Fix swallowed NPE in KafkaServer.close() (#5339)
1918f5c is described below
commit 1918f5cb5b5ebbcfb80d19521e2ee7734346a32b
Author: Chia-Ping Tsai <[email protected]>
AuthorDate: Thu Aug 30 07:01:17 2018 +0800
MINOR: Fix swallowed NPE in KafkaServer.close() (#5339)
If the server fails to connect to zk, `kafkaScheduler` will be `null`
when closing `KafkaServer`. The NPE is swallowed so it's
harmless apart from the confusing log noise.
Reviewers: Ismael Juma <[email protected]>
---
core/src/main/scala/kafka/server/KafkaServer.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/src/main/scala/kafka/server/KafkaServer.scala
b/core/src/main/scala/kafka/server/KafkaServer.scala
index c2a49a1..0d13d9e 100755
--- a/core/src/main/scala/kafka/server/KafkaServer.scala
+++ b/core/src/main/scala/kafka/server/KafkaServer.scala
@@ -576,7 +576,8 @@ class KafkaServer(val config: KafkaConfig, time: Time =
Time.SYSTEM, threadNameP
if (requestHandlerPool != null)
CoreUtils.swallow(requestHandlerPool.shutdown(), this)
- CoreUtils.swallow(kafkaScheduler.shutdown(), this)
+ if (kafkaScheduler != null)
+ CoreUtils.swallow(kafkaScheduler.shutdown(), this)
if (apis != null)
CoreUtils.swallow(apis.close(), this)