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


##########
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 
   Sounds good. 
   I included both messages.
   
   Because, `expiredBatch` includes both `inFlightBatch` and not 
`inFlightBatch`. 
   So, I think it would be good to include both! 
   
   Please let me know your opinion! 🙇‍♂️ 
   



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