kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1366238 - /incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala
Date Thu, 26 Jul 2012 23:56:59 GMT
Author: junrao
Date: Thu Jul 26 23:56:59 2012
New Revision: 1366238

URL: http://svn.apache.org/viewvc?rev=1366238&view=rev
Log:
NullPointerException in ConsumerFetcherManager; patched by Jun Rao; reviewed by Neha Narkhede;
KAFKA-418

Modified:
    incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala

Modified: incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala?rev=1366238&r1=1366237&r2=1366238&view=diff
==============================================================================
--- incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala
(original)
+++ incubator/kafka/branches/0.8/core/src/main/scala/kafka/consumer/ConsumerFetcherManager.scala
Thu Jul 26 23:56:59 2012
@@ -107,14 +107,18 @@ class ConsumerFetcherManager(private val
   }
 
   def stopAllConnections() {
+    // first, clear noLeaderPartitionSet so that no more fetchers can be added to leader_finder_thread
     lock.lock()
-    try {
-      partitionMap = null
-      noLeaderPartitionSet.clear()
-    } finally {
-      lock.unlock()
-    }
+    noLeaderPartitionSet.clear()
+    lock.unlock()
+
+    // second, stop all existing fetchers
     closeAllFetchers()
+
+    // finally clear partitionMap
+    lock.lock()
+    partitionMap = null
+    lock.unlock()
   }
 
   def getPartitionTopicInfo(key: (String, Int)) : PartitionTopicInfo = {



Mime
View raw message