From 1078747c9b9ff7df6fcece2bf5e2a801d4811ef7 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 29 Oct 2025 15:49:10 -0400 Subject: [PATCH] ESQL: Work around concurrent serialization bug 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 #137338 --- muted-tests.yml | 3 --- .../java/org/elasticsearch/test/AbstractWireTestCase.java | 4 ++-- .../java/org/elasticsearch/xpack/esql/EsqlTestUtils.java | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index afb4f96091acf..56f044b24e0d3 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -504,9 +504,6 @@ tests: - class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT method: test {p0=esql/40_tsdb/error on rename timestamp} issue: https://github.com/elastic/elasticsearch/issues/137259 -- class: org.elasticsearch.xpack.esql.plan.physical.ShowExecSerializationTests - method: testConcurrentSerialization - issue: https://github.com/elastic/elasticsearch/issues/137338 - class: org.elasticsearch.readiness.ReadinessClusterIT method: testReadinessDuringRestartsNormalOrder issue: https://github.com/elastic/elasticsearch/issues/136955 diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java index 61e2fb81d92ca..8c491632e3cc5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java @@ -200,8 +200,8 @@ public final void testConcurrentSerialization() throws InterruptedException, Exe for (int r = 0; r < rounds; r++) { assertSerialization(testInstance); } - } catch (IOException e) { - throw new AssertionError("error serializing", e); + } catch (IOException | AssertionError e) { + throw new AssertionError("error serializing [" + testInstance + "]", e); } }); } finally { diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java b/x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java index 68810e0686813..185004d87f01c 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java @@ -1060,6 +1060,13 @@ private static ExponentialHistogram randomExponentialHistogram() { ExponentialHistogramCircuitBreaker.noop(), rawValues ); + /* + * hashcode mutates the histogram by doing some lazy work. + * That can change the value of the hashCode if you call it concurrently.... + * This works around that by running it once up front. Jonas will have a + * look at this one soon. + */ + histo.hashCode(); return histo; }