appchemist commented on code in PR #16043:
URL: https://github.com/apache/kafka/pull/16043#discussion_r1630919078


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java:
##########
@@ -145,6 +154,7 @@ void runOnce() {
                 .map(networkClientDelegate::addAll)
                 .reduce(MAX_POLL_TIMEOUT_MS, Math::min);
         networkClientDelegate.poll(pollWaitTimeMs, currentTimeMs);
+        maybePropagateMetadataError();

Review Comment:
   I looked at `ConsumerNetworkThread.run()` because `Metadata.fatalException` 
is now propagated along with `InvalidTopicException` due to this change.
   When I looked at the code, there was the code where 
`networkClientDelegate.poll` was actually called separately in addition to 
`ConsumerNetworkThread.runOnce()`.
   ```
       // ConsumerNetworkThread.run()
       public void run() {
           try {
               ...
               while (running) {
                   ...
                   runOnce();
                   ...
               }
           } finally {
               // call networkClientDelegate.poll()
               cleanup();
           }
       }
   ```
   Therefore, I thought that the Metadata error might be missed at least once 
when the `AsyncKafkaConsumer.close()` is called and there are a Metadata error.
   So I applied it to the `NetworkClientDelegate`.
   
   Let me know if I've misunderstood



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