dajac commented on a change in pull request #11035:
URL: https://github.com/apache/kafka/pull/11035#discussion_r668869654



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/admin/internals/RemoveMembersFromConsumerGroupHandler.java
##########
@@ -82,52 +83,114 @@ public String apiName() {
         final LeaveGroupResponse response = (LeaveGroupResponse) 
abstractResponse;

Review comment:
       As we expect only `groupId`, I would verify the `groupIds` here and in 
`buildRequest`.

##########
File path: 
clients/src/main/java/org/apache/kafka/clients/admin/internals/RemoveMembersFromConsumerGroupHandler.java
##########
@@ -82,52 +83,114 @@ public String apiName() {
         final LeaveGroupResponse response = (LeaveGroupResponse) 
abstractResponse;
         Map<CoordinatorKey, Map<MemberIdentity, Errors>> completed = new 
HashMap<>();
         Map<CoordinatorKey, Throwable> failed = new HashMap<>();
-        List<CoordinatorKey> unmapped = new ArrayList<>();
+        final Set<CoordinatorKey> groupsToUnmap = new HashSet<>();
+        final Set<CoordinatorKey> groupsToRetry = new HashSet<>();
 
-        final Errors error = Errors.forCode(response.data().errorCode());
+        final Errors error = response.topLevelError();
         if (error != Errors.NONE) {
-            handleError(groupId, error, failed, unmapped);
+            handleGroupError(groupId, error, failed, groupsToUnmap, 
groupsToRetry);
         } else {
             final Map<MemberIdentity, Errors> memberErrors = new HashMap<>();
             for (MemberResponse memberResponse : response.memberResponses()) {
+                Errors memberError = 
Errors.forCode(memberResponse.errorCode());
+                String memberId = memberResponse.memberId();
+
+                if (memberError != Errors.NONE) {
+                    handleMemberError(groupId, memberId, memberError, 
groupsToUnmap, groupsToRetry);

Review comment:
       Is this really necessary? It seems that group level errors as always 
retuned as top level error in the response. Do you confirm?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to