guozhangwang commented on pull request #9836:
URL: https://github.com/apache/kafka/pull/9836#issuecomment-765592268


   Hey @vvcephei I was concerned about not the tests actually, it just rang to 
me if we should be paranoid about any side-effects for a tighter consumer loop 
in user code like:
   
   ```
   while (running()) {
       records = consumer.poll();
       if (!records.isEmpty()) // process them
   }
   ```
   
   Before this loop is iterated say N times every second, and now it could be M 
times every second where M >> N but we are still returning the same number of 
records in every sec. If user's process logic does not have, e.g., `if 
(!records.isEmpty())` or they have some computational logic for every `records` 
variable returned no matter if it is empty, then users may see their CPU 
increases surprisingly.
   
   But I also realized that the above change I made would effectively "kill" 
the purpose of this approach. So probably we do not have a better solution ATM 
without even larger API changes, and we'd just bite it and see if there's any 
surprises.


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to