Skip to content

Commit b6eb6e3

Browse files
authored
Suppress illegal reflective access in shared cache (#70344)
This commit temporarily supressess an illegal reflective access warning by opening the java.io module to all unnamed modules. This is needed when using the searchable snapshots shared cache due to some reflective access that occurs there. This is temporary while we explore alternatives.
1 parent e00eeed commit b6eb6e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/SystemJvmOptions.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ static List<String> systemJvmOptions() {
5656
* Due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise time/date
5757
* parsing will break in an incompatible way for some date patterns and locales.
5858
*/
59-
"-Djava.locale.providers=SPI,COMPAT"
59+
"-Djava.locale.providers=SPI,COMPAT",
60+
/*
61+
* Temporarily suppress illegal reflective access in searchable snapshots shared cache preallocation; this is temporary while we
62+
* explore alternatives. See org.elasticsearch.xpack.searchablesnapshots.preallocate.Preallocate.
63+
*
64+
* TODO: either modularlize Elasticsearch so that we can limit the opening of this module, or find an alternative
65+
*/
66+
"--add-opens=java.base/java.io=ALL-UNNAMED"
6067
).stream().filter(e -> e.isEmpty() == false).collect(Collectors.toList());
6168
}
6269

0 commit comments

Comments
 (0)