AndrewJSchofield commented on code in PR #20159:
URL: https://github.com/apache/kafka/pull/20159#discussion_r2207446496


##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -1225,7 +1230,9 @@ private ClusterAndWaitTime waitOnMetadata(String topic, 
Integer partition, long
                 if (metadata.getError(topic) != null) {
                     throw new TimeoutException(errorMessage, 
metadata.getError(topic).exception());
                 }
-                throw new TimeoutException(errorMessage);
+                if (ex.getCause() != null)
+                    throw new TimeoutException(errorMessage, ex.getCause());
+                throw new TimeoutException(errorMessage, new 
PotentialCauseException("Metadata update timed out ― topic missing, auth 
denied, broker/partition unavailable, or client sender/buffer stalled."));

Review Comment:
   Sounds good to me also. There's no need to create a KIP for this approach 
and it gives just as much information to the user.



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