lianetm commented on code in PR #14690: URL: https://github.com/apache/kafka/pull/14690#discussion_r1382666539
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/MemberState.java: ########## @@ -48,26 +61,50 @@ public enum MemberState { * {@link org.apache.kafka.common.protocol.Errors#FENCED_MEMBER_EPOCH} error from the * broker. This is a recoverable state, where the member * gives up its partitions by invoking the user callbacks for onPartitionsLost, and then - * transitions to {@link #UNJOINED} to rejoin the group as a new member. + * transitions to {@link #JOINING} to rejoin the group as a new member. */ FENCED, /** - * The member failed with an unrecoverable error + * The member transitions to this state when it is leaving the group after a call to + * unsubscribe. It stays in this state while releasing its assignment (calling user's callback + * for partitions revoked or lost), until the callback completes and a heartbeat request is + * sent out to effectively leave the group (without waiting for a response). + */ + LEAVING_GROUP, + + /** + * Member has completed releasing its assignment, and stays in this state until the next + * heartbeat request is sent out to leave the group. */ - FAILED; + SENDING_LEAVE_REQUEST, Review Comment: You're right about what each does, and agree with the `PREPARE_LEAVING` and `LEAVING`. Renamed them and updated comments, it looks clearer. -- 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