add check for StackOverflowError
@@ -233,6 +233,7 @@ public class IndexName implements Comparable<IndexName> {
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
+ try {
NodeState indexNode = rootState;
for (String e : PathUtils.elements(indexPath)) {
indexNode = indexNode.getChildNode(e);
@@ -243,6 +244,10 @@ public class IndexName implements Comparable<IndexName> {
}
}
return isIndexActiveMerged(indexNode, rootState);
+ } catch (StackOverflowError e) {
+ LOG.error("Fail to check index activeness for {} with error {}", indexPath, e);
+ }
+ return true;
}
private static boolean isIndexActiveMerged(NodeState indexNode, NodeState rootState) {
