accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [4/5] git commit: ACCUMULO-2154 Ignore NoNodeException while getting DeadServerList
Date Thu, 23 Jan 2014 17:15:12 GMT
ACCUMULO-2154 Ignore NoNodeException while getting DeadServerList

Signed-off-by: Keith Turner <kturner@apache.org>


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

Branch: refs/heads/master
Commit: ecdd8528ddf0108919ec48dc545e765c2c3aa364
Parents: 182f152
Author: Vikram Srivastava <vikrams@cloudera.com>
Authored: Thu Jan 23 02:42:19 2014 -0800
Committer: Keith Turner <kturner@apache.org>
Committed: Thu Jan 23 12:14:38 2014 -0500

----------------------------------------------------------------------
 .../accumulo/server/master/state/DeadServerList.java     | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ecdd8528/server/base/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
b/server/base/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
index b2ea7d6..e1ffd2f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
 import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.data.Stat;
+import org.apache.zookeeper.KeeperException.NoNodeException;
 
 public class DeadServerList {
   private static final Logger log = Logger.getLogger(DeadServerList.class);
@@ -49,7 +50,15 @@ public class DeadServerList {
       if (children != null) {
         for (String child : children) {
           Stat stat = new Stat();
-          byte[] data = zoo.getData(path + "/" + child, stat);
+          byte[] data;
+          try {
+            data = zoo.getData(path + "/" + child, stat);
+          } catch (NoNodeException nne) {
+            // Another thread or process can delete child while this loop is running.
+            // We ignore this error since it's harmless if we miss the deleted server
+            // in the dead server list.
+            continue;
+          }
           DeadServer server = new DeadServer(child, stat.getMtime(), new String(data));
           result.add(server);
         }


Mime
View raw message