activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject git commit: Avoid logging ZooKeeper related exceptions during a replicated leveldb store shutdown.
Date Thu, 03 Oct 2013 14:42:51 GMT
Updated Branches:
  refs/heads/trunk 531d67cd1 -> a5ac1a363


Avoid logging ZooKeeper related exceptions during a replicated leveldb store shutdown.


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

Branch: refs/heads/trunk
Commit: a5ac1a3630cd6af4f09d35dd63d45d3150ba9e53
Parents: 531d67c
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Thu Oct 3 10:33:17 2013 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Thu Oct 3 10:42:45 2013 -0400

----------------------------------------------------------------------
 .../activemq/leveldb/replicated/ElectingLevelDBStore.scala     | 3 ++-
 .../leveldb/replicated/groups/internal/ZooKeeperGroup.scala    | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/a5ac1a36/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
index decc506..7c82dd5 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
@@ -179,7 +179,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
     zk_client.start
     zk_client.waitForConnected(Timespan.parse("30s"))
 
-    val zk_group = ZooKeeperGroupFactory.create(zk_client, zkPath)
+    zk_group = ZooKeeperGroupFactory.create(zk_client, zkPath)
     val master_elector = new MasterElector(this)
     debug("Starting ZooKeeper group monitor")
     master_elector.start(zk_group)
@@ -267,6 +267,7 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
     if(brokerService!=null){
       brokerService.getManagementContext().unregisterMBean(objectName);
     }
+    zk_group.close
     zk_client.close()
     zk_client = null
     if( master_started.get() ) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/a5ac1a36/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/groups/internal/ZooKeeperGroup.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/groups/internal/ZooKeeperGroup.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/groups/internal/ZooKeeperGroup.scala
index f416013..a44cc22 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/groups/internal/ZooKeeperGroup.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/groups/internal/ZooKeeperGroup.scala
@@ -70,13 +70,17 @@ class ZooKeeperGroup(val zk: ZKClient, val root: String) extends Group
with Life
   create(root)
   tree.track(new NodeEventsListener[Array[Byte]]() {
     def onEvents(events: Collection[NodeEvent[Array[Byte]]]): Unit = {
-      fire_cluster_change
+      if( !closed )
+        fire_cluster_change
     }
   })
   fire_cluster_change
 
+  @volatile
+  var closed = false
 
   def close = this.synchronized {
+    closed = true
     joins.foreach { case (path, version) =>
       try {
         zk.delete(member_path_prefix + path, version)


Mime
View raw message