hachikuji commented on a change in pull request #8934: URL: https://github.com/apache/kafka/pull/8934#discussion_r450960971
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java ########## @@ -1218,17 +1218,20 @@ public void assign(Collection<TopicPartition> partitions) { throw new IllegalStateException("Consumer is not subscribed to any topics or assigned any partitions"); } - // poll for new data until the timeout expires do { client.maybeTriggerWakeup(); if (includeMetadataInTimeout) { - // try to update assignment metadata BUT do not need to block on the timer, - // since even if we are 1) in the middle of a rebalance or 2) have partitions - // with unknown starting positions we may still want to return some data - // as long as there are some partitions fetchable; NOTE we always use a timer with 0ms - // to never block on completing the rebalance procedure if there's any - updateAssignmentMetadataIfNeeded(time.timer(0L)); + // try to update assignment metadata BUT do not need to block on the timer if we still have Review comment: Hmm, not sure if I buy that. `trySend` would only return a value less than 5s if there was a pending request which needed to be send. However, as soon as it got sent, it would go back to 5s. So I'm not sure if it alone can account for a tight poll loop. ---------------------------------------------------------------- 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