diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index 87dc1b8b6184b..04b5a62715caa 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -18,7 +18,7 @@ */ dependencies { - compile 'org.jruby.joni:joni:2.1.6' + compile 'org.jruby.joni:joni:2.1.29' // joni dependencies: compile 'org.jruby.jcodings:jcodings:1.0.44' @@ -30,10 +30,3 @@ dependencies { forbiddenApisMain { replaceSignatureFiles 'jdk-signatures' } - -thirdPartyAudit.ignoreMissingClasses ( - // joni has AsmCompilerSupport, but that isn't being used: - 'org.objectweb.asm.ClassWriter', - 'org.objectweb.asm.MethodVisitor', - 'org.objectweb.asm.Opcodes' -) diff --git a/libs/grok/licenses/joni-2.1.29.jar.sha1 b/libs/grok/licenses/joni-2.1.29.jar.sha1 new file mode 100644 index 0000000000000..251ff2ec05a19 --- /dev/null +++ b/libs/grok/licenses/joni-2.1.29.jar.sha1 @@ -0,0 +1 @@ +3cb751702e1194ff24259155db4d37e9383d4320 \ No newline at end of file diff --git a/libs/grok/licenses/joni-2.1.6.jar.sha1 b/libs/grok/licenses/joni-2.1.6.jar.sha1 deleted file mode 100644 index 48abe138a8fd6..0000000000000 --- a/libs/grok/licenses/joni-2.1.6.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0f23c95a06eaecbc8c74c7458a8bfd13e4fd2d3a \ No newline at end of file diff --git a/libs/grok/src/main/java/org/elasticsearch/grok/Grok.java b/libs/grok/src/main/java/org/elasticsearch/grok/Grok.java index 473e8626a4c42..07f75fd995b26 100644 --- a/libs/grok/src/main/java/org/elasticsearch/grok/Grok.java +++ b/libs/grok/src/main/java/org/elasticsearch/grok/Grok.java @@ -175,7 +175,9 @@ public String toRegex(String grokPattern) { int result; try { threadWatchdog.register(); - result = matcher.search(0, grokPatternBytes.length, Option.NONE); + result = matcher.searchInterruptible(0, grokPatternBytes.length, Option.NONE); + } catch (InterruptedException e) { + result = Matcher.INTERRUPTED; } finally { threadWatchdog.unregister(); } @@ -224,7 +226,9 @@ public boolean match(String text) { int result; try { threadWatchdog.register(); - result = matcher.search(0, text.length(), Option.DEFAULT); + result = matcher.searchInterruptible(0, text.length(), Option.DEFAULT); + } catch (InterruptedException e) { + result = Matcher.INTERRUPTED; } finally { threadWatchdog.unregister(); } @@ -244,7 +248,9 @@ public Map captures(String text) { int result; try { threadWatchdog.register(); - result = matcher.search(0, textAsBytes.length, Option.DEFAULT); + result = matcher.searchInterruptible(0, textAsBytes.length, Option.DEFAULT); + } catch (InterruptedException e) { + result = Matcher.INTERRUPTED; } finally { threadWatchdog.unregister(); }