diff --git a/Jenkinsfile b/Jenkinsfile index a966bf26d94b2..cfdf72268f363 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -142,10 +142,10 @@ pipeline { } } - stage('JDK 15 and Scala 2.13') { + stage('JDK 16 and Scala 2.13') { agent { label 'ubuntu' } tools { - jdk 'jdk_15_latest' + jdk 'jdk_16_latest' } options { timeout(time: 8, unit: 'HOURS') @@ -157,7 +157,7 @@ pipeline { steps { doValidation() doTest(env) - echo 'Skipping Kafka Streams archetype test for Java 15' + echo 'Skipping Kafka Streams archetype test for Java 16' } } @@ -231,14 +231,14 @@ pipeline { } } - stage('JDK 15 and Scala 2.12') { + stage('JDK 16 and Scala 2.12') { when { not { changeRequest() } beforeAgent true } agent { label 'ubuntu' } tools { - jdk 'jdk_15_latest' + jdk 'jdk_16_latest' } options { timeout(time: 8, unit: 'HOURS') @@ -250,7 +250,7 @@ pipeline { steps { doValidation() doTest(env) - echo 'Skipping Kafka Streams archetype test for Java 15' + echo 'Skipping Kafka Streams archetype test for Java 16' } } } diff --git a/clients/src/main/java/org/apache/kafka/common/network/Selector.java b/clients/src/main/java/org/apache/kafka/common/network/Selector.java index 38880f2038e24..79a9c08199734 100644 --- a/clients/src/main/java/org/apache/kafka/common/network/Selector.java +++ b/clients/src/main/java/org/apache/kafka/common/network/Selector.java @@ -603,7 +603,7 @@ void pollSelectionKeys(Set selectionKeys, } catch (Exception e) { String desc = channel.socketDescription(); if (e instanceof IOException) { - log.debug("Connection with {} disconnected", desc, e); + log.error("Connection with {} disconnected", desc, e); } else if (e instanceof AuthenticationException) { boolean isReauthentication = channel.successfulAuthentications() > 0; if (isReauthentication) @@ -613,10 +613,10 @@ void pollSelectionKeys(Set selectionKeys, String exceptionMessage = e.getMessage(); if (e instanceof DelayedResponseAuthenticationException) exceptionMessage = e.getCause().getMessage(); - log.info("Failed {}authentication with {} ({})", isReauthentication ? "re-" : "", + log.error("Failed {}authentication with {} ({})", isReauthentication ? "re-" : "", desc, exceptionMessage); } else { - log.warn("Unexpected error from {}; closing connection", desc, e); + log.error("Unexpected error from {}; closing connection", desc, e); } if (e instanceof DelayedResponseAuthenticationException) diff --git a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java index 44187134225fc..9f72f37229648 100644 --- a/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java +++ b/clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java @@ -29,13 +29,15 @@ import org.apache.kafka.common.security.auth.SecurityProtocol; import org.apache.kafka.common.security.ssl.DefaultSslEngineFactory; import org.apache.kafka.common.security.ssl.SslFactory; -import org.apache.kafka.common.utils.Java; +//import org.apache.kafka.common.utils.Java; import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.test.TestSslUtils; import org.apache.kafka.test.TestUtils; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -128,10 +130,11 @@ private static class SslTransportLayerArgumentsProvider implements ArgumentsProv public Stream provideArguments(ExtensionContext context) throws Exception { List parameters = new ArrayList<>(); parameters.add(Arguments.of(new Args("TLSv1.2", false))); - parameters.add(Arguments.of(new Args("TLSv1.2", true))); - if (Java.IS_JAVA11_COMPATIBLE) { - parameters.add(Arguments.of(new Args("TLSv1.3", false))); - } +// Disable temporarily to make debugging easier +// parameters.add(Arguments.of(new Args("TLSv1.2", true))); +// if (Java.IS_JAVA11_COMPATIBLE) { +// parameters.add(Arguments.of(new Args("TLSv1.3", false))); +// } return parameters.stream(); } } @@ -591,7 +594,7 @@ public void testInvalidKeyPassword(Args args) throws Exception { } /** - * Tests that connection success with the default TLS version. + * Tests that connection succeeds with the default TLS version. */ @ParameterizedTest @ArgumentsSource(SslTransportLayerArgumentsProvider.class) @@ -611,12 +614,6 @@ public void testTlsDefaults(Args args) throws Exception { NetworkTestUtils.checkClientConnection(selector, "0", 10, 100); server.verifyAuthenticationMetrics(1, 0); selector.close(); - - checkAuthenticationFailed(args, "1", "TLSv1.1"); - server.verifyAuthenticationMetrics(1, 1); - - checkAuthenticationFailed(args, "2", "TLSv1"); - server.verifyAuthenticationMetrics(1, 2); } /** Checks connection failed using the specified {@code tlsVersion}. */ @@ -636,12 +633,14 @@ private void checkAuthenticationFailed(Args args, String node, String tlsVersion */ @ParameterizedTest @ArgumentsSource(SslTransportLayerArgumentsProvider.class) - public void testUnsupportedTLSVersion(Args args) throws Exception { - args.sslServerConfigs.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, Arrays.asList("TLSv1.2")); + public void testUnsupportedTlsVersion(Args args) throws Exception { server = createEchoServer(args, SecurityProtocol.SSL); checkAuthenticationFailed(args, "0", "TLSv1.1"); server.verifyAuthenticationMetrics(0, 1); + + checkAuthenticationFailed(args, "0", "TLSv1"); + server.verifyAuthenticationMetrics(0, 2); } /**