akatona84 commented on code in PR #11565: URL: https://github.com/apache/kafka/pull/11565#discussion_r1141776979
########## connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java: ########## @@ -328,6 +335,48 @@ public Set<String> createTopics(NewTopic... topics) { return createOrFindTopics(topics).createdTopics(); } + /** + * Implements a retry logic around creating topic(s) in case it'd fail due to InvalidReplicationFactorException + * + * @param topicDescription + * @param timeoutMs + * @param backOffMs + * @param time + * @return the same as {@link TopicAdmin#createTopics(NewTopic...)} + */ + public Set<String> createTopicsWithRetry(NewTopic topicDescription, long timeoutMs, long backOffMs, Time time) { Review Comment: That retrier is constructed for actually retriable exception and in our case the exception is wrapped in another exception and don't really want to touch/refactor/hack this utility method to handle these kind of exceptions too and adding more not-necessarily retryable exceptions to check in the condition where it retries. This refactor would change the semantics of the retries where it's being used currently. long story short, I feel this topic creation retry is a bit special and wouldn't been used this way in many places later on. -- 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