Skip to content

Commit 14eeb27

Browse files
committed
Merge branch 'main' into inference_metadata_fields
2 parents 9b36f55 + 47be542 commit 14eeb27

File tree

59 files changed

+1265
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1265
-109
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchTestBasePlugin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.gradle.test.GradleTestPolicySetupPlugin;
2121
import org.elasticsearch.gradle.test.SystemPropertyCommandLineArgumentProvider;
2222
import org.gradle.api.Action;
23+
import org.gradle.api.JavaVersion;
2324
import org.gradle.api.Plugin;
2425
import org.gradle.api.Project;
2526
import org.gradle.api.Task;
@@ -112,7 +113,6 @@ public void execute(Task t) {
112113
test.jvmArgs(
113114
"-Xmx" + System.getProperty("tests.heap.size", "512m"),
114115
"-Xms" + System.getProperty("tests.heap.size", "512m"),
115-
"-Djava.security.manager=allow",
116116
"-Dtests.testfeatures.enabled=true",
117117
"--add-opens=java.base/java.util=ALL-UNNAMED",
118118
// TODO: only open these for mockito when it is modularized
@@ -127,6 +127,13 @@ public void execute(Task t) {
127127
);
128128

129129
test.getJvmArgumentProviders().add(new SimpleCommandLineArgumentProvider("-XX:HeapDumpPath=" + heapdumpDir));
130+
test.getJvmArgumentProviders().add(() -> {
131+
if (test.getJavaVersion().compareTo(JavaVersion.VERSION_23) <= 0) {
132+
return List.of("-Djava.security.manager=allow");
133+
} else {
134+
return List.of();
135+
}
136+
});
130137

131138
String argline = System.getProperty("tests.jvm.argline");
132139
if (argline != null) {

build-tools/src/main/java/org/elasticsearch/gradle/test/GradleTestPolicySetupPlugin.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99

1010
package org.elasticsearch.gradle.test;
1111

12+
import org.gradle.api.JavaVersion;
1213
import org.gradle.api.Plugin;
1314
import org.gradle.api.Project;
1415
import org.gradle.api.invocation.Gradle;
1516
import org.gradle.api.tasks.testing.Test;
1617

18+
import java.util.List;
19+
1720
public class GradleTestPolicySetupPlugin implements Plugin<Project> {
1821

1922
@Override
@@ -23,8 +26,13 @@ public void apply(Project project) {
2326
test.systemProperty("tests.gradle", true);
2427
test.systemProperty("tests.task", test.getPath());
2528

26-
// Flag is required for later Java versions since our tests use a custom security manager
27-
test.jvmArgs("-Djava.security.manager=allow");
29+
test.getJvmArgumentProviders().add(() -> {
30+
if (test.getJavaVersion().compareTo(JavaVersion.VERSION_23) <= 0) {
31+
return List.of("-Djava.security.manager=allow");
32+
} else {
33+
return List.of();
34+
}
35+
});
2836

2937
SystemPropertyCommandLineArgumentProvider nonInputProperties = new SystemPropertyCommandLineArgumentProvider();
3038
// don't track these as inputs since they contain absolute paths and break cache relocatability

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.common.util.concurrent.EsExecutors;
14+
import org.elasticsearch.core.UpdateForV9;
15+
import org.elasticsearch.jdk.RuntimeVersionFeature;
1416

1517
import java.io.IOException;
1618
import java.nio.file.Files;
@@ -137,9 +139,13 @@ private static Stream<String> maybeWorkaroundG1Bug() {
137139
return Stream.of();
138140
}
139141

142+
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
140143
private static Stream<String> maybeAllowSecurityManager() {
141-
// Will become conditional on useEntitlements once entitlements can run without SM
142-
return Stream.of("-Djava.security.manager=allow");
144+
if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
145+
// Will become conditional on useEntitlements once entitlements can run without SM
146+
return Stream.of("-Djava.security.manager=allow");
147+
}
148+
return Stream.of();
143149
}
144150

145151
private static Stream<String> maybeAttachEntitlementAgent(boolean useEntitlements) {

docs/changelog/118025.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118025
2+
summary: Update sparse text embeddings API route for Inference Service
3+
area: Inference
4+
type: enhancement
5+
issues: []

docs/changelog/118177.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 118177
2+
summary: Fixing bedrock event executor terminated cache issue
3+
area: Machine Learning
4+
type: bug
5+
issues:
6+
- 117916

docs/changelog/118267.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118267
2+
summary: Adding get migration reindex status
3+
area: Data streams
4+
type: enhancement
5+
issues: []

docs/changelog/118354.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118354
2+
summary: Fix log message format bugs
3+
area: Ingest Node
4+
type: bug
5+
issues: []

docs/changelog/118378.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118378
2+
summary: Opt into extra data stream resolution
3+
area: ES|QL
4+
type: bug
5+
issues: []
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.jdk;
11+
12+
import org.elasticsearch.core.UpdateForV9;
13+
14+
public class RuntimeVersionFeature {
15+
private RuntimeVersionFeature() {}
16+
17+
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // Remove once we removed all references to SecurityManager in code
18+
public static boolean isSecurityManagerAvailable() {
19+
return Runtime.version().feature() < 24;
20+
}
21+
}

libs/secure-sm/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ tasks.named('forbiddenApisMain').configure {
2828
tasks.named("jarHell").configure { enabled = false }
2929
tasks.named("testTestingConventions").configure {
3030
baseClass 'junit.framework.TestCase'
31+
baseClass 'org.junit.Assert'
3132
}

0 commit comments

Comments
 (0)