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



##########
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:
       I'm thinking that moving forward we should try to not create internal 
topics during rebalance but try pre-create in starting, but for now assuming 
this is still the case I think letting the whole application to die is fine --- 
i.e. treat it the same as source topics. Hence I'm leaning towards encoding 
INCOMPLETE_SOURCE_TOPIC_METADATA to shutdown the whole app, across all clients.




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