Skip to content

Commit 5ce27e3

Browse files
authored
Grant manage_threads to java.desktop for Tika (#134454) (#134559) (#134580)
* Grant manage_threads to java.desktop for Tika * Produce a PolicyScope for excluded system modules. Fortunately, the JDK is still modular even if the tests are run sans modules, so we can use the module API to identify the packages in every system module. * TODO with Jira link
1 parent 7fe3799 commit 5ce27e3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/HardcodedEntitlements.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
113113
new FilesEntitlement(serverModuleFileDatas)
114114
)
115115
),
116-
new Scope("java.desktop", List.of(new LoadNativeLibrariesEntitlement())),
116+
new Scope(
117+
"java.desktop",
118+
List.of(
119+
new LoadNativeLibrariesEntitlement(),
120+
new ManageThreadsEntitlement() // For sun.java2d.Disposer. TODO: https://elasticco.atlassian.net/browse/ES-12888
121+
)
122+
),
117123
new Scope("org.apache.httpcomponents.httpclient", List.of(new OutboundNetworkEntitlement())),
118124
new Scope(
119125
"org.apache.lucene.core",

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public class PolicyManager {
134134

135135
static final Class<?> DEFAULT_FILESYSTEM_CLASS = PathUtils.getDefaultFileSystem().getClass();
136136

137-
static final Set<String> MODULES_EXCLUDED_FROM_SYSTEM_MODULES = Set.of("java.desktop");
137+
public static final Set<String> MODULES_EXCLUDED_FROM_SYSTEM_MODULES = Set.of("java.desktop");
138138

139139
/**
140140
* Identifies a particular entitlement {@link Scope} within a {@link Policy}.
@@ -174,7 +174,7 @@ public enum ComponentKind {
174174
* If this kind corresponds to a single component, this is that component's name;
175175
* otherwise null.
176176
*/
177-
final String componentName;
177+
public final String componentName;
178178

179179
ComponentKind(String componentName) {
180180
this.componentName = componentName;

0 commit comments

Comments
 (0)