guozhangwang commented on a change in pull request #11231:
URL: https://github.com/apache/kafka/pull/11231#discussion_r694477094



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
##########
@@ -476,7 +476,6 @@ boolean joinGroupIfNeeded(final Timer timer) {
                 else if (!future.isRetriable())
                     throw exception;
 
-                resetStateAndRejoin(String.format("rebalance failed with 
retriable error %s", exception));

Review comment:
       After reading https://github.com/apache/kafka/pull/10986 again I think I 
agree with you. The original corner case is that during a rebalance if the hb 
thread detect we've already lost the membership, i.e. falling in line 458, we 
should also reset the flag. We would not need to do more than that.
   
   About removing this line as a whole, one nit thought we probably still want 
to reset `rejoinNeeded` here --- this is probably not a correctness issue since 
in `rejoinNeededOrPending` we check both conditions `rejoinNeeded || joinFuture 
!= null;` and the second is still true. But I feel resetting it makes the logic 
a bit cleaner.




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