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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -415,7 +415,9 @@ private long sendProducerData(long now) {
         for (ProducerBatch expiredBatch : expiredBatches) {
             String errorMessage = "Expiring " + expiredBatch.recordCount + " 
record(s) for " + expiredBatch.topicPartition
                 + ":" + (now - expiredBatch.createdMs) + " ms has passed since 
batch creation";
-            failBatch(expiredBatch, new TimeoutException(errorMessage), false);
+            KafkaException potentialCause = new KafkaException(
+                    "The broker might be unavailable or responding slowly, or 
the CPU might be busy.");
+            failBatch(expiredBatch, new TimeoutException(errorMessage, 
potentialCause), false);

Review Comment:
   @chia7712 Thanks for your comments!
   I'm not sure I fully agree. 
   From my perspective, `errorMessage` only indicates how many records are 
expired; it doesn’t indicate why those records are expired.
   Therefore, I think it would be clearer to keep it as it is, since 
`potentialCause` explains the reason behind the expiration.
   
   What do you think?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to