You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/03/30 01:11:08 UTC

[GitHub] [jackrabbit-oak] Ewocker commented on a change in pull request #530: Add check for StackOverflowError

Ewocker commented on a change in pull request #530:
URL: https://github.com/apache/jackrabbit-oak/pull/530#discussion_r838026795



##########
File path: oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/IndexName.java
##########
@@ -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;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org