Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA69110A73 for ; Wed, 17 Jul 2013 18:10:32 +0000 (UTC) Received: (qmail 51246 invoked by uid 500); 17 Jul 2013 18:10:32 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 51104 invoked by uid 500); 17 Jul 2013 18:10:32 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 50991 invoked by uid 99); 17 Jul 2013 18:10:27 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jul 2013 18:10:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A51628AC6BA; Wed, 17 Jul 2013 18:10:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ecn@apache.org To: commits@accumulo.apache.org Date: Wed, 17 Jul 2013 18:10:28 -0000 Message-Id: <014f557b78684a8e92ef0eacd3cf1595@git.apache.org> In-Reply-To: <409295456c37416aa2a17f9c6ee2bed9@git.apache.org> References: <409295456c37416aa2a17f9c6ee2bed9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/4] 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/1.5.1-SNAPSHOT Commit: 7b617230979811d0e0ec8fffa6b633b70278c466 Parents: c82c431 Author: Eric Newton Authored: Wed Jul 17 14:08:53 2013 -0400 Committer: Eric Newton 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);