From d40a0c3bd88b7098437050eeb3e3f5c6ef5f5502 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Tue, 15 Nov 2016 13:09:25 -0800 Subject: [PATCH] HBASE-17091 IntegrationTestZKAndFSPermissions failed with 'KeeperException' --- .../test/IntegrationTestZKAndFSPermissions.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestZKAndFSPermissions.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestZKAndFSPermissions.java index 9d30b7ce8d3..0d85e4273b3 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestZKAndFSPermissions.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestZKAndFSPermissions.java @@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.util.ToolRunner; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException.Code; +import org.apache.zookeeper.KeeperException.NoNodeException; import org.apache.zookeeper.ZooDefs.Ids; import org.apache.zookeeper.ZooDefs.Perms; import org.apache.zookeeper.data.ACL; @@ -168,7 +169,7 @@ public class IntegrationTestZKAndFSPermissions extends AbstractHBaseTool { } } catch (KeeperException ke) { // if we are not authenticated for listChildren, it is fine. - if (ke.code() != Code.NOAUTH) { + if (ke.code() != Code.NOAUTH && ke.code() != Code.NONODE) { throw ke; } } @@ -177,7 +178,14 @@ public class IntegrationTestZKAndFSPermissions extends AbstractHBaseTool { private void assertZnodePerms(RecoverableZooKeeper zk, String znode, boolean expectedWorldReadable) throws KeeperException, InterruptedException { Stat stat = new Stat(); - List acls = zk.getZooKeeper().getACL(znode, stat); + List acls; + try { + acls = zk.getZooKeeper().getACL(znode, stat); + } catch (NoNodeException ex) { + LOG.debug("Caught exception for missing znode", ex); + // the znode is deleted. Probably it was a temporary znode (like RIT). + return; + } String[] superUsers = superUser == null ? null : superUser.split(","); LOG.info("Checking ACLs for znode znode:" + znode + " acls:" + acls);