KAFKA-16916: Fixing error in completing future (#16249)

Fix to complete Future which was stuck due the exception.getCause() throws an error.

The fix in the #16217 unblocked blocking thread but exception in catch block from blocking get call was wrapped in ExecutionException which is not the case when moved to async workflow hence getCause is not needed.

Reviewers: Luke Chen <showuon@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Apoorv Mittal 2024-06-08 07:25:54 +01:00 committed by GitHub
parent d13a693ea7
commit 96036aee85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 5 deletions

View File

@ -2326,7 +2326,7 @@ public class KafkaAdminClient extends AdminClient {
clusterResult.nodes().whenComplete(
(nodes, exception) -> {
if (exception != null) {
completeAllExceptionally(topicFutures.values(), exception.getCause());
completeAllExceptionally(topicFutures.values(), exception);
return;
}

View File

@ -40,7 +40,6 @@ import org.apache.kafka.common.utils.MockTime;
import org.apache.kafka.test.TestUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.time.Duration;
@ -111,9 +110,6 @@ public class ClientAuthenticationFailureTest {
}
@Test
// The test runs forever on trunk after c01279b9. (KAFKA-16916)
// We disable the test temporarily until we fix it to unblock the CI.
@Disabled
public void testAdminClientWithInvalidCredentials() {
Map<String, Object> props = new HashMap<>(saslClientConfigs);
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + server.port());