kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-825; KafkaController.isActive() needs to be synchronized; patched by Jun Rao; reviewed by Neha Narkhede
Date Mon, 25 Mar 2013 17:47:36 GMT
Updated Branches:
  refs/heads/0.8 df221297c -> e367f3ffb


kafka-825; KafkaController.isActive() needs to be synchronized; patched by Jun Rao; reviewed
by Neha Narkhede


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

Branch: refs/heads/0.8
Commit: e367f3ffb3340a0f0c0f46b0787d12476d751815
Parents: df22129
Author: Jun Rao <junrao@gmail.com>
Authored: Mon Mar 25 10:47:29 2013 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Mon Mar 25 10:47:29 2013 -0700

----------------------------------------------------------------------
 .../scala/kafka/controller/KafkaController.scala   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/e367f3ff/core/src/main/scala/kafka/controller/KafkaController.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/KafkaController.scala b/core/src/main/scala/kafka/controller/KafkaController.scala
index 6e07096..229239c 100644
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -251,7 +251,9 @@ class KafkaController(val config : KafkaConfig, zkClient: ZkClient) extends
Logg
    * Returns true if this broker is the current controller.
    */
   def isActive(): Boolean = {
-    controllerContext.controllerChannelManager != null
+    controllerContext.controllerLock synchronized {
+      controllerContext.controllerChannelManager != null
+    }
   }
 
   /**


Mime
View raw message