Skip to content

Commit 0a07043

Browse files
Revert "Upgrade jcodings dependency to 1.0.44 (#43334)" (#48899)
This reverts commit 08a3549 and adds a test that demonstrates that grok with ignore case fails with the new dependency (jcodings 1.0.44 has a breaking change compared to 1.0.12, also requiring an upgrade of joni). This would crash ES with a `NoSuchFieldErrror` when using case insensitive matching.
1 parent 1f9ee18 commit 0a07043

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

libs/grok/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
dependencies {
2121
compile 'org.jruby.joni:joni:2.1.6'
2222
// joni dependencies:
23-
compile 'org.jruby.jcodings:jcodings:1.0.44'
23+
compile 'org.jruby.jcodings:jcodings:1.0.12'
2424

2525
testCompile(project(":test:framework")) {
2626
exclude group: 'org.elasticsearch', module: 'elasticsearch-grok'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6bc17079fcaa8823ea8cd0d4c66516335b558db8

libs/grok/licenses/jcodings-1.0.44.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ public void testMatch() throws Exception {
4545
assertThat(doc.getFieldValue("one", String.class), equalTo("1"));
4646
}
4747

48+
public void testIgnoreCase() throws Exception {
49+
String fieldName = RandomDocumentPicks.randomFieldName(random());
50+
IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());
51+
doc.setFieldValue(fieldName, "A");
52+
GrokProcessor processor = new GrokProcessor(randomAlphaOfLength(10), Collections.emptyMap(),
53+
Collections.singletonList("(?<a>(?i)A)"), fieldName, false, false, ThreadWatchdog.noop());
54+
processor.execute(doc);
55+
assertThat(doc.getFieldValue("a", String.class), equalTo("A"));
56+
}
57+
4858
public void testNoMatch() {
4959
String fieldName = RandomDocumentPicks.randomFieldName(random());
5060
IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());

0 commit comments

Comments
 (0)