showuon commented on a change in pull request #11566:
URL: https://github.com/apache/kafka/pull/11566#discussion_r764003611



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
##########
@@ -2303,18 +2303,24 @@ public ConsumerGroupMetadata groupMetadata() {
      * @throws java.lang.IllegalStateException if the consumer does not use 
group subscription
      */
     @Override
-    public void enforceRebalance() {
+    public void enforceRebalance(final String reason) {

Review comment:
       Why does the new API not have new java doc for it? 

##########
File path: core/src/main/scala/kafka/coordinator/group/GroupCoordinator.scala
##########
@@ -181,6 +182,7 @@ class GroupCoordinator(val brokerId: Int,
           responseCallback(JoinGroupResult(memberId, Errors.UNKNOWN_MEMBER_ID))
         case Some(group) =>
           group.inLock {
+            info(s"memberId=$memberId with groupInstanceId=$groupInstanceId is 
attempting to join groupId=$groupId due to: $reason")

Review comment:
       Since the consumer might be in the old version, the `reason` might be 
`null`. I think we should not output the log when the `reason` is null. i.e.:
   `memberId=1 with groupInstanceId=2 is attempting to join groupId=3 due to: 
null`




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