Skip to content
Permalink
Browse files
add check for StackOverflowError
  • Loading branch information
Ewocker committed Mar 29, 2022
1 parent 353de17 commit 4e89276e56c781a4e4f8c8cae4176ecaa82de18e
Showing 1 changed file with 13 additions and 8 deletions.
@@ -233,16 +233,21 @@ public String nextCustomizedName() {
private static boolean isIndexActive(String indexPath, NodeState rootState) {
// An index is active if it has a hidden child node that starts with ":oak:mount-",
// OR if it is an active merged index
NodeState indexNode = rootState;
for(String e : PathUtils.elements(indexPath)) {
indexNode = indexNode.getChildNode(e);
}
for(String c : indexNode.getChildNodeNames()) {
if (c.startsWith(":oak:mount-")) {
return true;
try {
NodeState indexNode = rootState;
for (String e : PathUtils.elements(indexPath)) {
indexNode = indexNode.getChildNode(e);
}
for (String c : indexNode.getChildNodeNames()) {
if (c.startsWith(":oak:mount-")) {
return true;
}
}
return isIndexActiveMerged(indexNode, rootState);
} catch (StackOverflowError e) {
LOG.error("Fail to check index activeness for {} with error {}", indexPath, e);
}
return isIndexActiveMerged(indexNode, rootState);
return true;
}

private static boolean isIndexActiveMerged(NodeState indexNode, NodeState rootState) {

0 comments on commit 4e89276

Please sign in to comment.