Skip to content

Commit 92737df

Browse files
committed
iter2
1 parent 281ca0e commit 92737df

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/reference/ingest/ingest-node.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,9 +1515,9 @@ This can be useful to reference as the built-in patterns change across versions.
15151515
[[grok-watchdog]]
15161516
==== Grok watchdog
15171517

1518-
Grok expression that take too long to execute are interrupted and
1519-
the the grok processor then fails with an exception. The grok
1520-
processor has a watchdog thread that determines when evaluation
1518+
Grok expressions that take too long to execute are interrupted and
1519+
the grok processor then fails with an exception. The grok
1520+
processor has a watchdog thread that determines when evaluation of
15211521
a grok expression takes too long and is controlled by the following
15221522
settings:
15231523

libs/grok/src/main/java/org/elasticsearch/grok/Grok.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public Map<String, Object> captures(String text) {
249249
threadWatchdog.unregister();
250250
}
251251
if (result == Matcher.INTERRUPTED) {
252-
throw new IllegalArgumentException("grok pattern matching was interrupted after [" +
252+
throw new RuntimeException("grok pattern matching was interrupted after [" +
253253
threadWatchdog.maxExecutionTime() + "] ms");
254254
} else if (result == Matcher.FAILED) {
255255
// TODO: I think we should throw an error here?

libs/grok/src/test/java/org/elasticsearch/grok/GrokTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public void testExponentialExpressions() {
435435
return null;
436436
};
437437
Grok grok = new Grok(basePatterns, grokPattern, ThreadWatchdog.newInstance(10, 200, System::currentTimeMillis, scheduler));
438-
Exception e = expectThrows(IllegalArgumentException.class, () -> grok.captures(logLine));
438+
Exception e = expectThrows(RuntimeException.class, () -> grok.captures(logLine));
439439
run.set(false);
440440
assertThat(e.getMessage(), equalTo("grok pattern matching was interrupted after [200] ms"));
441441
}

0 commit comments

Comments
 (0)