Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More jdk upgrade #2868

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,6 @@ private void error(Element element, String message) {
fullMessage.append("): ");
fullMessage.append(message);

if (Runtime.version().feature() == 11 && element.getKind() == ElementKind.PACKAGE) {
// Avoid JDK 11 bug:
// https://issues.apache.org/jira/browse/LUCENE-9747
// https://bugs.openjdk.java.net/browse/JDK-8224082
reporter.print(Diagnostic.Kind.ERROR, fullMessage.toString());
} else {
reporter.print(Diagnostic.Kind.ERROR, element, fullMessage.toString());
}
reporter.print(Diagnostic.Kind.ERROR, element, fullMessage.toString());
}
}
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ apply from: file('gradle/java/javac.gradle')
apply from: file('gradle/testing/defaults-tests.gradle')
apply from: file('gradle/testing/randomization.gradle')
apply from: file('gradle/testing/fail-on-no-tests.gradle')
apply from: file('gradle/testing/fail-on-unsupported-jdk.gradle')
apply from: file('gradle/testing/alternative-jdk-support.gradle')
apply from: file('gradle/java/jar-manifest.gradle')
apply from: file('gradle/testing/retry-test.gradle')
Expand Down Expand Up @@ -205,7 +204,6 @@ apply from: file('gradle/hacks/global-exclude-dependencies.gradle')
apply from: file('gradle/hacks/gradle-archives.gradle')

apply from: file('gradle/hacks/wipe-temp.gradle')
apply from: file('gradle/hacks/hashmapAssertions.gradle')
apply from: file('gradle/hacks/turbocharge-jvm-opts.gradle')
apply from: file('gradle/hacks/dummy-outputs.gradle')

Expand Down
33 changes: 0 additions & 33 deletions gradle/hacks/hashmapAssertions.gradle

This file was deleted.

32 changes: 0 additions & 32 deletions gradle/testing/fail-on-unsupported-jdk.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,12 @@ private void init(ServletContext servletContext) {
}

// Do initial logs for experimental Lucene classes.
// TODO: Use "MethodHandles.lookup().ensureClassInitialized()" instead of "Class.forName()"
// once JDK 15+ is mandatory
final var lookup = MethodHandles.lookup();
Stream.of(MMapDirectory.class, VectorUtil.class)
.forEach(
cls -> {
try {
Class.forName(cls.getName());
lookup.ensureInitialized(cls);
} catch (ReflectiveOperationException re) {
throw new SolrException(
ErrorCode.SERVER_ERROR, "Could not load Lucene class: " + cls.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.solr.util;

import com.carrotsearch.randomizedtesting.RandomizedTest;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
Expand All @@ -27,7 +26,6 @@
import java.security.UnrecoverableKeyException;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import java.util.regex.Pattern;
import javax.net.ssl.SSLContext;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
Expand All @@ -38,7 +36,6 @@
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.ssl.SSLContextBuilder;
import org.apache.http.ssl.SSLContexts;
import org.apache.lucene.util.Constants;
import org.apache.solr.client.solrj.embedded.SSLConfig;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
import org.apache.solr.client.solrj.impl.HttpClientUtil.SocketFactoryRegistryProvider;
Expand Down Expand Up @@ -108,10 +105,6 @@ public SSLTestConfig(boolean useSsl, boolean clientAuth, boolean checkPeerName)
this.clientAuth = clientAuth;
this.checkPeerName = checkPeerName;

if (this.useSsl) {
assumeSslIsSafeToTest();
}

final String resourceName =
checkPeerName ? TEST_KEYSTORE_LOCALHOST_RESOURCE : TEST_KEYSTORE_BOGUSHOST_RESOURCE;
trustStore = keyStore = Resource.newClassPathResource(resourceName);
Expand Down Expand Up @@ -414,50 +407,4 @@ public void reseed(SecureRandomParameters params) {
/* NOOP */
}
}

/**
* Helper method for sanity checking if it's safe to use SSL on this JVM
*
* @see <a href="https://issues.apache.org/jira/browse/SOLR-12988">SOLR-12988</a>
* @throws org.junit.internal.AssumptionViolatedException if this JVM is known to have SSL
* problems
*/
public static void assumeSslIsSafeToTest() {
if (Constants.JVM_NAME.startsWith("OpenJDK")
|| Constants.JVM_NAME.startsWith("Java HotSpot(TM)")) {
RandomizedTest.assumeFalse(
"Test (or randomization for this seed) wants to use SSL, "
+ "but SSL is known to fail on your JVM: "
+ Constants.JVM_NAME
+ " / "
+ Constants.JVM_VERSION,
isOpenJdkJvmVersionKnownToHaveProblems(Constants.JVM_VERSION));
}
}

/**
* package visibility for tests
*
* @see Constants#JVM_VERSION
* @lucene.internal
*/
static boolean isOpenJdkJvmVersionKnownToHaveProblems(final String jvmVersion) {
// TODO: would be nice to replace with Runtime.Version once we don't have to
// worry about java8 support when backporting to branch_8x
return KNOWN_BAD_OPENJDK_JVMS.matcher(jvmVersion).matches();
}

private static final Pattern KNOWN_BAD_OPENJDK_JVMS =
Pattern.compile( // 11 to 11.0.2 were all definitely problematic
// - https://bugs.openjdk.java.net/browse/JDK-8212885
// - https://bugs.openjdk.java.net/browse/JDK-8213202
"(^11(\\.0(\\.0|\\.1|\\.2)?)?($|(\\_|\\+|\\-).*$))|"
+
// early (pre-ea) "testing" builds of 11, 12, and 13 were also buggy
// - https://bugs.openjdk.java.net/browse/JDK-8224829
"(^(11|12|13).*-testing.*$)|"
+
// So far, all 13-ea builds (up to 13-ea-26) have been buggy
// - https://bugs.openjdk.java.net/browse/JDK-8226338
"(^13-ea.*$)");
}

This file was deleted.

Loading