You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation for filter path evaluation is really inefficient, recursively invoking method for every . pattern, when many of those can be skipped altogether. For example, it breaks for simple match all request with 4k . appended together (assuming small size JVM like 512k):
using existing more efficient libraries for matching the pattern against string (cons: additional dependency)
Related component
Search:Resiliency
To Reproduce
opensearch-node1 | java.lang.StackOverflowError
opensearch-node1 | at java.base/java.lang.RuntimeException.<init>(RuntimeException.java:52)
opensearch-node1 | at java.base/java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:40)
opensearch-node1 | at java.base/java.util.regex.PatternSyntaxException.<init>(PatternSyntaxException.java:58)
opensearch-node1 | at java.base/java.util.regex.Pattern.error(Pattern.java:2028)
opensearch-node1 | at java.base/java.util.regex.Pattern.<init>(Pattern.java:1432)
opensearch-node1 | at java.base/java.util.regex.Pattern.compile(Pattern.java:1069)
opensearch-node1 | at java.base/java.lang.String.replaceAll(String.java:2944)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:119)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:120)
opensearch-node1 | at org.opensearch.core.xcontent.filtering.FilterPath.parse(FilterPath.java:12
Expected behavior
There should not be any stack overflow error
Related component
Search:Resiliency
Expected behavior
There should not be any stack overflow error
The text was updated successfully, but these errors were encountered:
Describe the bug
The current implementation for filter path evaluation is really inefficient, recursively invoking method for every . pattern, when many of those can be skipped altogether. For example, it breaks for simple match all request with 4k . appended together (assuming small size JVM like 512k):
Extract from FilterPath.java
Solution
Can be written more efficiently by:
Related component
Search:Resiliency
To Reproduce
Expected behavior
There should not be any stack overflow error
Related component
Search:Resiliency
Expected behavior
There should not be any stack overflow error
The text was updated successfully, but these errors were encountered: