dajac commented on code in PR #16057:
URL: https://github.com/apache/kafka/pull/16057#discussion_r1613785754


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -4424,14 +4441,113 @@ private ConsumerGroupMember 
validateConsumerGroupMember(
      * @param context        The request context.
      * @param request        The actual LeaveGroup request.
      *
+     * @return The LeaveGroup response and the records to append.
+     */
+    public CoordinatorResult<LeaveGroupResponseData, CoordinatorRecord> 
classicGroupLeave(
+        RequestContext context,
+        LeaveGroupRequestData request
+    ) throws UnknownMemberIdException, GroupIdNotFoundException {
+        Group group = groups.get(request.groupId(), Long.MAX_VALUE);
+
+        if (group == null) {
+            throw new UnknownMemberIdException(String.format("Group %s not 
found.", request.groupId()));
+        }

Review Comment:
   Perhaps, a better strategy overall would be to always use 
`GroupIdNotFoundException` internally and to translate it to 
`UnknownMemberIdException` where needed (e.g. by catching and rethrowing) with 
a comment explaining why.



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