You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/07/23 18:54:42 UTC

[17/50] git commit: ACCUMULO-1572 ignore connection lost; eventually we'll get an session lost event

ACCUMULO-1572 ignore connection lost; eventually we'll get an session lost event


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

Branch: refs/heads/ACCUMULO-1000
Commit: 7b617230979811d0e0ec8fffa6b633b70278c466
Parents: c82c431
Author: Eric Newton <er...@gmail.com>
Authored: Wed Jul 17 14:08:53 2013 -0400
Committer: Eric Newton <er...@gmail.com>
Committed: Wed Jul 17 14:08:53 2013 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7b617230/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
index 961539a..fb2f3d8 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
@@ -235,7 +235,7 @@ public class ZooLock implements Watcher {
               lostLock(LockLossReason.LOCK_DELETED);
             } else if (asyncLock != null && event.getType() == EventType.NodeDeleted && event.getPath().equals(path + "/" + asyncLock)) {
               failedToAcquireLock();
-            } else if (event.getState() != KeeperState.Expired && (lock != null || asyncLock != null)) {
+            } else if (event.getState() != KeeperState.Disconnected && event.getState() != KeeperState.Expired && (lock != null || asyncLock != null)) {
               log.debug("Unexpected event watching lock node "+event+" "+asyncLockPath);
               try {
                 Stat stat2 = zooKeeper.getStatus(asyncLockPath, this);
@@ -349,6 +349,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);