kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-4227; Shutdown AdminManager when KafkaServer is shutdown
Date Wed, 28 Sep 2016 19:55:12 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.1 66b2caafe -> 7e67d87c1


KAFKA-4227; Shutdown AdminManager when KafkaServer is shutdown

Terminate topic purgatory thread in AdminManager during server shutdown to avoid threads being
left around in unit tests.

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #1927 from rajinisivaram/KAFKA-4227

(cherry picked from commit 281fac9ed626b16190d56e609c9bf04a3188374a)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/7e67d87c
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/7e67d87c
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/7e67d87c

Branch: refs/heads/0.10.1
Commit: 7e67d87c121414fa16465fa34309053c9531b9ac
Parents: 66b2caa
Author: Rajini Sivaram <rajinisivaram@googlemail.com>
Authored: Wed Sep 28 20:18:20 2016 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed Sep 28 20:55:06 2016 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/AdminManager.scala | 4 ++++
 core/src/main/scala/kafka/server/KafkaServer.scala  | 2 ++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/7e67d87c/core/src/main/scala/kafka/server/AdminManager.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/AdminManager.scala b/core/src/main/scala/kafka/server/AdminManager.scala
index 9c5fe73..8cb2270 100644
--- a/core/src/main/scala/kafka/server/AdminManager.scala
+++ b/core/src/main/scala/kafka/server/AdminManager.scala
@@ -155,4 +155,8 @@ class AdminManager(val config: KafkaConfig,
       topicPurgatory.tryCompleteElseWatch(delayedDelete, delayedDeleteKeys)
     }
   }
+
+  def shutdown() {
+    topicPurgatory.shutdown()
+  }
 }

http://git-wip-us.apache.org/repos/asf/kafka/blob/7e67d87c/core/src/main/scala/kafka/server/KafkaServer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/KafkaServer.scala b/core/src/main/scala/kafka/server/KafkaServer.scala
index 5055c87..4ba9b2a 100755
--- a/core/src/main/scala/kafka/server/KafkaServer.scala
+++ b/core/src/main/scala/kafka/server/KafkaServer.scala
@@ -589,6 +589,8 @@ class KafkaServer(val config: KafkaConfig, time: Time = SystemTime, threadNamePr
         CoreUtils.swallow(authorizer.foreach(_.close()))
         if(replicaManager != null)
           CoreUtils.swallow(replicaManager.shutdown())
+        if (adminManager != null)
+          CoreUtils.swallow(adminManager.shutdown())
         if(logManager != null)
           CoreUtils.swallow(logManager.shutdown())
         if(groupCoordinator != null)


Mime
View raw message