appchemist commented on PR #15961:
URL: https://github.com/apache/kafka/pull/15961#issuecomment-2149560613

   @lianetm Thanks for review!
   
   I agree that the Manager approach is a bit like an overkill.
   
   For issues that have different timing to legacy consumers, I think about it 
like this
   At the code level view
   For the Legacy consumer, the code order is to call 
`Metadata.maybeThrowAnyException()` roughly after `KafkaClient.poll()`.
   For the Manager approach, the code order is to call `KafkaClient.poll()` 
roughly after `Metadata.maybeThrowAnyException()`.
   So they look semantically different.
   
   However, when viewed at the `ConsumerNetworkThread` level, this is roughly 
how it works
   ```
   // in ConsumerNetworkThread.run()
   while (running) {
       // Omit some
       Metadata.maybeThrowAnyException();
       KafkaClient.poll();
   }
   ```
   If we only look at the calls to `KafkaClient.poll()` and 
`Metadata.maybeThrowAnyException()`, which is what we're interested in, it 
looks like this
   `Metadata.maybeThrowAnyException() -> KafkaClient.poll() -> 
Metadata.maybeThrowAnyException() -> ...`
   Therefore, I think there is no significant time difference physically, but I 
think it's bad for code readability
   
   Please let me know if I've misunderstood anything


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