kirktrue commented on code in PR #12813:
URL: https://github.com/apache/kafka/pull/12813#discussion_r1082997268


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -552,9 +552,11 @@ private void handleProduceResponse(ClientResponse 
response, Map<TopicPartition,
         if (response.wasDisconnected()) {
             log.trace("Cancelled request with header {} due to node {} being 
disconnected",
                 requestHeader, response.destination());
-            for (ProducerBatch batch : batches.values())
-                completeBatch(batch, new 
ProduceResponse.PartitionResponse(Errors.NETWORK_EXCEPTION, 
String.format("Disconnected from node %s", response.destination())),
+            for (ProducerBatch batch : batches.values()) {
+                Errors e = response.wasTimedOut() ? Errors.REQUEST_TIMED_OUT : 
Errors.NETWORK_EXCEPTION;
+                completeBatch(batch, new ProduceResponse.PartitionResponse(e, 
String.format("Disconnected from node %s", response.destination())),

Review Comment:
   I updated the patch to introduce a new `if` block for timeouts that is 
separate from disconnections, as you'd suggested. LMK if I interpreted your 
request correctly 😄 



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