accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [06/11] git commit: ACCUMULO-1572 apply missing patch; prevent logger from killing itself on a Disconnect event
Date Tue, 03 Sep 2013 13:01:40 GMT
ACCUMULO-1572 apply missing patch; prevent logger from killing itself on a Disconnect event


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

Branch: refs/heads/master
Commit: 4ed51ecbca7d4120c5c31531ecbebb5d56a7b79f
Parents: 3e97167
Author: Eric Newton <ecn@apache.org>
Authored: Fri Aug 30 11:00:57 2013 -0400
Committer: Eric Newton <ecn@apache.org>
Committed: Fri Aug 30 11:00:57 2013 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/server/logger/LogService.java  | 4 ++++
 .../main/java/org/apache/accumulo/server/zookeeper/ZooLock.java  | 3 +++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4ed51ecb/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java b/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
index b386234..ebfc287 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
@@ -373,6 +373,8 @@ public class LogService implements MutationLogger.Iface, Watcher {
   @Override
   public void process(WatchedEvent event) {
     LOG.debug("event " + event.getPath() + " " + event.getType() + " " + event.getState());
+    if (event.getState() == KeeperState.Disconnected)
+      return;
     
     if (event.getState() == KeeperState.Expired) {
       LOG.warn("Logger lost zookeeper registration at " + event.getPath());
@@ -391,6 +393,8 @@ public class LogService implements MutationLogger.Iface, Watcher {
         LOG.fatal("Stopping server, zookeeper entry lost " + event.getPath());
         service.stop();
       }
+    } catch (KeeperException.ConnectionLossException ex) {
+      LOG.info("Disconnected from zookeeper");
     } catch (Exception ex) {
       LOG.fatal("Stopping server, cannot reset watch" + ex);
       service.stop();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4ed51ecb/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java b/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
index 03e84a7..c7e2f2f 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
@@ -344,6 +344,9 @@ public class ZooLock implements Watcher {
       try { // set the watch on the parent node again
         zooKeeper.getStatus(path, this);
         watchingParent = true;
+      } catch (KeeperException.ConnectionLossException ex) {
+        // we can't look at the lock because we aren't connected, but our session is still
good
+        log.warn("lost connection to zookeeper");
       } catch (Exception ex) {
         if (lock != null || asyncLock != null) {
           lockWatcher.unableToMonitorLockNode(ex);


Mime
View raw message