lianetm commented on code in PR #16569: URL: https://github.com/apache/kafka/pull/16569#discussion_r1681358088
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java: ########## @@ -587,6 +617,14 @@ public void transitionToFatal() { return; } + if (previousState == MemberState.LEAVING || previousState == MemberState.PREPARE_LEAVING) { + log.info("Member {} with epoch {} was leaving the group with state {} when it got a " + + "fatal error from the broker. It will discard the ongoing leave and remain in {} " + + "state.", memberId, memberEpoch, previousState, state); + maybeCompleteLeaveInProgress(); Review Comment: All in the above response. The state is indeed not `UNSUBSCRIBE` here, the state is FATAL and we do have to `maybeCompleteLeaveInProgress` (to make sure we complete a leave operation that was running before we got the fatal error in a HB response while let's say, running onPartitionsRevoked callback to leave the group). Makes sense? -- 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