urbandan commented on code in PR #11565:
URL: https://github.com/apache/kafka/pull/11565#discussion_r1133617771


##########
connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:
##########
@@ -360,10 +361,20 @@ public Set<String> createTopicsWithRetry(NewTopic 
topicDescription, long timeout
 
     private boolean retryableTopicCreationException(ConnectException e) {
         // createTopics wraps the exception into ConnectException
-        // which can be an ExecutionException from future get which was caused 
by InvalidReplicationFactorException
+        // to retry the creation, it should be an ExecutionException from 
future get which was caused by InvalidReplicationFactorException
         // or can be a TimeoutException
-        return e.getCause() instanceof ExecutionException && 
e.getCause().getCause() instanceof InvalidReplicationFactorException
-                || e.getCause() instanceof TimeoutException;
+        List<Class<? extends Exception>> causesToRetry = Arrays.asList(
+                InvalidReplicationFactorException.class,
+                TimeoutException.class);

Review Comment:
   wondering if it makes sense to check for TimeoutException with the latest 
config changes - if the admin client itself encounters a timeout, and we use 
the same timeout config, this is probably not necessary anymore



##########
connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:
##########
@@ -360,10 +361,20 @@ public Set<String> createTopicsWithRetry(NewTopic 
topicDescription, long timeout
 
     private boolean retryableTopicCreationException(ConnectException e) {
         // createTopics wraps the exception into ConnectException
-        // which can be an ExecutionException from future get which was caused 
by InvalidReplicationFactorException
+        // to retry the creation, it should be an ExecutionException from 
future get which was caused by InvalidReplicationFactorException
         // or can be a TimeoutException
-        return e.getCause() instanceof ExecutionException && 
e.getCause().getCause() instanceof InvalidReplicationFactorException
-                || e.getCause() instanceof TimeoutException;
+        List<Class<? extends Exception>> causesToRetry = Arrays.asList(

Review Comment:
   nit: should be a constant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to