Skip to content

Commit 8c8d0db

Browse files
Revert "Workaround for JDK 14 EA FileChannel.map issue (#50523)" (#51323)
This reverts commit c7fd24c. Now that JDK-8236582 is fixed in JDK 14 EA, we can revert the workaround. Relates #50523 and #50512
1 parent 157b352 commit 8c8d0db

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

server/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919

2020
package org.elasticsearch.bootstrap;
2121

22-
import org.apache.logging.log4j.LogManager;
2322
import org.apache.logging.log4j.Logger;
23+
import org.apache.logging.log4j.LogManager;
2424
import org.apache.logging.log4j.core.Appender;
2525
import org.apache.logging.log4j.core.LoggerContext;
2626
import org.apache.logging.log4j.core.appender.ConsoleAppender;
2727
import org.apache.logging.log4j.core.config.Configurator;
2828
import org.apache.lucene.util.Constants;
29+
import org.elasticsearch.core.internal.io.IOUtils;
2930
import org.apache.lucene.util.StringHelper;
3031
import org.elasticsearch.ElasticsearchException;
3132
import org.elasticsearch.Version;
@@ -41,7 +42,6 @@
4142
import org.elasticsearch.common.settings.SecureSettings;
4243
import org.elasticsearch.common.settings.Settings;
4344
import org.elasticsearch.common.transport.BoundTransportAddress;
44-
import org.elasticsearch.core.internal.io.IOUtils;
4545
import org.elasticsearch.env.Environment;
4646
import org.elasticsearch.monitor.jvm.JvmInfo;
4747
import org.elasticsearch.monitor.os.OsProbe;
@@ -160,24 +160,6 @@ static void initializeProbes() {
160160
JvmInfo.jvmInfo();
161161
}
162162

163-
/**
164-
* JDK 14 bug:
165-
* https://github.com/elastic/elasticsearch/issues/50512
166-
* We circumvent it here by loading the offending class before installing security manager.
167-
*
168-
* To be removed once the JDK is fixed.
169-
*/
170-
static void fixJDK14EAFileChannelMap() {
171-
// minor time-bomb here to ensure that we reevaluate if final 14 version does not include fix.
172-
if (System.getProperty("java.version").equals("14-ea")) {
173-
try {
174-
Class.forName("jdk.internal.misc.ExtendedMapMode", true, Bootstrap.class.getClassLoader());
175-
} catch (ClassNotFoundException e) {
176-
throw new RuntimeException("Unable to lookup ExtendedMapMode class", e);
177-
}
178-
}
179-
}
180-
181163
private void setup(boolean addShutdownHook, Environment environment) throws BootstrapException {
182164
Settings settings = environment.settings();
183165

@@ -229,8 +211,6 @@ public void run() {
229211
// Log ifconfig output before SecurityManager is installed
230212
IfConfig.logIfNecessary();
231213

232-
fixJDK14EAFileChannelMap();
233-
234214
// install SM after natives, shutdown hooks, etc.
235215
try {
236216
Security.configure(environment, BootstrapSettings.SECURITY_FILTER_BAD_DEFAULTS_SETTING.get(settings));

test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ public class BootstrapForTesting {
102102
// Log ifconfig output before SecurityManager is installed
103103
IfConfig.logIfNecessary();
104104

105-
Bootstrap.fixJDK14EAFileChannelMap();
106-
107105
// install security manager if requested
108106
if (systemPropertyAsBoolean("tests.security.manager", true)) {
109107
try {

0 commit comments

Comments
 (0)