C0urante commented on a change in pull request #11046: URL: https://github.com/apache/kafka/pull/11046#discussion_r754402147
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java ########## @@ -1235,9 +1236,15 @@ public void assign(Collection<TopicPartition> partitions) { } } - final Map<TopicPartition, List<ConsumerRecord<K, V>>> records = pollForFetches(timer); - if (!records.isEmpty()) { - // before returning the fetched records, we can send off the next round of fetches + final Fetch<K, V> fetch = pollForFetches(timer); + if (!fetch.isEmpty()) { + if (fetch.records().isEmpty()) { + log.debug( Review comment: I think that works. My goal with this line was to help people understand the cause for this new behavior, as it may seem like a bug at first if `poll` returns empty batches before the poll timeout has elapsed. I've taken a stab at a message that has functional value (i.e., naming the specific topic partition whose position has advanced without any user-visible records) and still tries to let the user know about how/why this may affect `poll` behavior; LMKWYT. Also, this section was pretty buggy as-was since it skipped the call to `client.transmitSends` and didn't pass the empty batch through the consumer's interceptors. I've fixed both of these; LMK if you think we should skip passing an empty batch to interceptors, though. -- 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