frankvicky commented on code in PR #17614: URL: https://github.com/apache/kafka/pull/17614#discussion_r2029109982
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManager.java: ########## @@ -182,7 +181,7 @@ public NetworkClientDelegate.PollResult poll(long currentTimeMs) { } // Case 1: The member is leaving - boolean heartbeatNow = membershipManager().state() == MemberState.LEAVING || + boolean heartbeatNow = isLeavingGroup() || Review Comment: `membershipManager#isLeavingGroup` considers `LEAVING` and `PREPARE_LEAVING` to be leaving the group. But in this flag, we only consider `LEAVING` since the flag determines whether the heartbeat should be sent immediately or not. `PREPARE_LEAVING` is the state that waits for callbacks to be executed. The key point is that it's confusing that HeartbeatRequestManager and MembershipManager have a method with the same name. Clearly, HeartbeatRequestManager cares about the timing of a leave request, not the member state. I will figure out a more appropriate name. -- 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