aliehsaeedii commented on code in PR #16344: URL: https://github.com/apache/kafka/pull/16344#discussion_r1650696721
########## clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java: ########## @@ -1175,19 +1176,26 @@ private ClusterAndWaitTime waitOnMetadata(String topic, Integer partition, long try { metadata.awaitUpdate(version, remainingWaitMs); } catch (TimeoutException ex) { + final String errorMessage = String.format("Topic %s not present in metadata after %d ms.", + topic, maxWaitMs); + if (metadata.getError(topic) != null) { + throw new TimeoutException(errorMessage, metadata.getError(topic).exception()); + } // Rethrow with original maxWaitMs to prevent logging exception with remainingWaitMs Review Comment: > Also just to be clear -- this code path is not one where we see anyting but retriable exceptions? I noticed the other path checks that but not this one. Please see https://github.com/apache/kafka/pull/16344#discussion_r1648061530 I personally think that fatal exceptions are thrown [here](https://github.com/apache/kafka/blob/3a0c83e49030074271dd34c20fa99baad6270c93/clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerMetadata.java#L123). -- 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