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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -641,7 +643,7 @@ private void completeBatch(ProducerBatch batch, 
ProduceResponse.PartitionRespons
                 // thus it is not safe to reassign the sequence.
                 failBatch(batch, response, batch.attempts() < this.retries);
             }
-            if (error.exception() instanceof InvalidMetadataException) {
+            if (error.exception() instanceof InvalidMetadataException || 
error.exception() instanceof TimeoutException) {

Review Comment:
   @dajac For disconnected/timed out connections, this is the call stack:
   
   ```java
   Sender.poll()
       NetworkClient.poll()
           DefaultMetadataUpdater.handleServerDisconnect()
               Metadata.requestUpdate()
   ````
   
   However, `SenderTest` uses `MockClient` which doesn't have that same logic 
flow. So if I remove that clause of the `if` statement, the test, as written, 
fails.



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