mjsax commented on a change in pull request #9060:
URL: https://github.com/apache/kafka/pull/9060#discussion_r464774778



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
##########
@@ -154,27 +164,34 @@ public InternalTopicManager(final Admin adminClient, 
final StreamsConfig streams
                                 "Error message was: {}", topicName, 
cause.toString());
                             throw new StreamsException(String.format("Could 
not create topic %s.", topicName), cause);
                         }
+                    } catch (final TimeoutException retryableException) {
+                        log.error("Creating topic {} timed out.\n" +
+                            "Error message was: {}", topicName, 
retryableException.toString());
                     }
                 }
             }
 
 
             if (!topicsNotReady.isEmpty()) {
-                log.info("Topics {} can not be made ready with {} retries 
left", topicsNotReady, remainingRetries);
+                currentWallClockMs = time.milliseconds();
 
-                Utils.sleep(retryBackOffMs);
+                if (currentWallClockMs >= deadlineMs) {
+                    final String timeoutError = String.format("Could not 
create topics within %d milliseconds. " +
+                        "This can happen if the Kafka cluster is temporary not 
available.", retryTimeoutMs);
+                    log.error(timeoutError);
+                    // TODO: should we throw a different exception instead and 
catch it, to return a `INCOMPLETE_SOURCE_TOPIC_METADATA` error code

Review comment:
       Ack




----------------------------------------------------------------
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.

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


Reply via email to