diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index a9f8284fdd5..659343c76bd 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -354,7 +354,11 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager { //Overwrite any info stored by table, this takes precedence try { if(ZKUtil.checkExists(watcher, groupBasePath) != -1) { - for(String znode: ZKUtil.listChildrenAndWatchForNewChildren(watcher, groupBasePath)) { + List children = ZKUtil.listChildrenAndWatchForNewChildren(watcher, groupBasePath); + if (children == null) { + return RSGroupInfoList; + } + for(String znode: children) { byte[] data = ZKUtil.getData(watcher, ZNodePaths.joinZNode(groupBasePath, znode)); if(data.length > 0) { ProtobufUtil.expectPBMagicPrefix(data); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java index f29d133d843..57d929da545 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ZKProcedureMemberRpcs.java @@ -135,8 +135,12 @@ public class ZKProcedureMemberRpcs implements ProcedureMemberRpcs { LOG.debug("Checking for aborted procedures on node: '" + zkController.getAbortZnode() + "'"); try { // this is the list of the currently aborted procedues - for (String node : ZKUtil.listChildrenAndWatchForNewChildren(zkController.getWatcher(), - zkController.getAbortZnode())) { + List children = ZKUtil.listChildrenAndWatchForNewChildren(zkController.getWatcher(), + zkController.getAbortZnode()); + if (children == null || children.isEmpty()) { + return; + } + for (String node : children) { String abortNode = ZNodePaths.joinZNode(zkController.getAbortZnode(), node); abort(abortNode); }