Skip to content

Commit 4ca22b9

Browse files
committed
Update bundled JDK to 25 (elastic#134910)
Co-authored-by: Mark Vieira <[email protected]> (cherry picked from commit 4aa0f16) # Conflicts: # x-pack/plugin/esql/build.gradle
1 parent 2520a96 commit 4ca22b9

File tree

12 files changed

+34
-14
lines changed

12 files changed

+34
-14
lines changed

build-tools-internal/src/main/resources/fips_java.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jdk.xml.dsig.secureValidationPolicy=\
4949
noRetrievalMethodLoops
5050
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5151
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
52+
53+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
54+
jdk.includeInExceptions=hostInfoExclSocket

build-tools-internal/src/main/resources/fips_java_oracle.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ jdk.xml.dsig.secureValidationPolicy=\
5050
noRetrievalMethodLoops
5151
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5252
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
53+
54+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
55+
jdk.includeInExceptions=hostInfoExclSocket

build-tools-internal/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ elasticsearch = 8.19.5
22
lucene = 9.12.2
33

44
bundled_jdk_vendor = openjdk
5-
bundled_jdk = 24.0.2+12@fdc5d0102fe0414db21410ad5834341f
5+
bundled_jdk = 25+36@bd75d5f9689641da8e1daabeccb5528b
66
# optional dependencies
77
spatial4j = 0.7
88
jts = 1.15.0

client/rest/src/test/java/org/elasticsearch/client/RestClientMultipleHostsIntegTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import static org.elasticsearch.client.RestClientTestUtil.randomErrorNoRetryStatusCode;
5050
import static org.elasticsearch.client.RestClientTestUtil.randomOkStatusCode;
5151
import static org.hamcrest.CoreMatchers.instanceOf;
52+
import static org.hamcrest.Matchers.startsWith;
5253
import static org.junit.Assert.assertEquals;
5354
import static org.junit.Assert.assertThat;
5455
import static org.junit.Assert.assertTrue;
@@ -314,7 +315,7 @@ public void testNodeSelector() throws Exception {
314315
} catch (ConnectException e) {
315316
// Windows isn't consistent here. Sometimes the message is even null!
316317
if (false == System.getProperty("os.name").startsWith("Windows")) {
317-
assertEquals("Connection refused", e.getMessage());
318+
assertThat(e.getMessage(), startsWith("Connection refused"));
318319
}
319320
}
320321
} else {

client/rest/src/test/java/org/elasticsearch/client/RestClientTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
import static java.util.Collections.singletonList;
4646
import static org.hamcrest.Matchers.instanceOf;
47+
import static org.hamcrest.Matchers.startsWith;
4748
import static org.junit.Assert.assertEquals;
4849
import static org.junit.Assert.assertFalse;
4950
import static org.junit.Assert.assertSame;
@@ -105,7 +106,7 @@ public void onSuccess(Response response) {
105106
public void onFailure(Exception exception) {
106107
try {
107108
assertThat(exception, instanceOf(IllegalArgumentException.class));
108-
assertEquals("Expected scheme name at index 0: ::http:///", exception.getMessage());
109+
assertThat(exception.getMessage(), startsWith(("Expected scheme name")));
109110
} finally {
110111
latch.countDown();
111112
}

test/test-clusters/src/main/resources/fips/fips_java.security

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jdk.xml.dsig.secureValidationPolicy=\
4949
noRetrievalMethodLoops
5050
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5151
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
52+
53+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
54+
jdk.includeInExceptions=hostInfoExclSocket

test/test-clusters/src/main/resources/fips/fips_java_oracle.security

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ jdk.xml.dsig.secureValidationPolicy=\
5050
noRetrievalMethodLoops
5151
jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\
5252
java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!*
53+
54+
# Needed since JDK25 to match the default config in the out-of-the-box java.security
55+
jdk.includeInExceptions=hostInfoExclSocket
56+

x-pack/plugin/esql/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ interface Injected {
8686
}
8787

8888
tasks.named("test").configure {
89+
// prevent empty stacktraces on JDK 25 for intrinsic Math.*Exact invocations
90+
// https://bugs.openjdk.org/browse/JDK-8367990
91+
// https://github.com/elastic/elasticsearch/issues/135009
92+
jvmArgs '-XX:-OmitStackTraceInFastThrow'
93+
8994
if (buildParams.ci == false) {
9095
systemProperty 'generateDocs', true
9196
def injected = project.objects.newInstance(Injected)

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/CustomRequestManagerTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import static org.elasticsearch.xpack.inference.Utils.inferenceUtilityPool;
2929
import static org.hamcrest.Matchers.is;
30+
import static org.hamcrest.Matchers.startsWith;
3031
import static org.mockito.Mockito.mock;
3132

3233
public class CustomRequestManagerTests extends ESTestCase {
@@ -81,6 +82,6 @@ public void testCreateRequest_ThrowsException_ForInvalidUrl() {
8182
var exception = expectThrows(ElasticsearchStatusException.class, () -> listener.actionGet(TimeValue.timeValueSeconds(30)));
8283

8384
assertThat(exception.getMessage(), is("Failed to construct the custom service request"));
84-
assertThat(exception.getCause().getMessage(), is("Failed to build URI, error: Illegal character in path at index 0: ^"));
85+
assertThat(exception.getCause().getMessage(), startsWith("Failed to build URI, error: Illegal character in path"));
8586
}
8687
}

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/request/CustomRequestTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
import static org.hamcrest.Matchers.instanceOf;
4242
import static org.hamcrest.Matchers.is;
43+
import static org.hamcrest.Matchers.startsWith;
4344

4445
public class CustomRequestTests extends ESTestCase {
4546

@@ -390,7 +391,7 @@ public void testCreateRequest_ThrowsException_ForInvalidUrl() {
390391
IllegalStateException.class,
391392
() -> new CustomRequest(RerankParameters.of(new QueryAndDocsInputs("query string", List.of("abc", "123"))), model)
392393
);
393-
assertThat(exception.getMessage(), is("Failed to build URI, error: Illegal character in path at index 0: ^"));
394+
assertThat(exception.getMessage(), startsWith("Failed to build URI, error: Illegal character in path"));
394395
}
395396

396397
private static String convertToString(InputStream inputStream) throws IOException {

0 commit comments

Comments
 (0)