Skip to content

Commit efe93f5

Browse files
nik9000chrisparrinello
authored andcommitted
ESQL: Work around concurrent serialization bug (elastic#137350)
The bug still exists in the underlying code, but it isn't released so I'm working around it by doing an eager call to `hashCode`. We'll fix the real bug real soon. Closes elastic#137338
1 parent 5e6e01a commit efe93f5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,6 @@ tests:
504504
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
505505
method: test {p0=esql/40_tsdb/error on rename timestamp}
506506
issue: https://github.com/elastic/elasticsearch/issues/137259
507-
- class: org.elasticsearch.xpack.esql.plan.physical.ShowExecSerializationTests
508-
method: testConcurrentSerialization
509-
issue: https://github.com/elastic/elasticsearch/issues/137338
510507
- class: org.elasticsearch.readiness.ReadinessClusterIT
511508
method: testReadinessDuringRestartsNormalOrder
512509
issue: https://github.com/elastic/elasticsearch/issues/136955

test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ public final void testConcurrentSerialization() throws InterruptedException, Exe
200200
for (int r = 0; r < rounds; r++) {
201201
assertSerialization(testInstance);
202202
}
203-
} catch (IOException e) {
204-
throw new AssertionError("error serializing", e);
203+
} catch (IOException | AssertionError e) {
204+
throw new AssertionError("error serializing [" + testInstance + "]", e);
205205
}
206206
});
207207
} finally {

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,13 @@ private static ExponentialHistogram randomExponentialHistogram() {
10601060
ExponentialHistogramCircuitBreaker.noop(),
10611061
rawValues
10621062
);
1063+
/*
1064+
* hashcode mutates the histogram by doing some lazy work.
1065+
* That can change the value of the hashCode if you call it concurrently....
1066+
* This works around that by running it once up front. Jonas will have a
1067+
* look at this one soon.
1068+
*/
1069+
histo.hashCode();
10631070
return histo;
10641071
}
10651072

0 commit comments

Comments
 (0)