You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/14 10:26:43 UTC

[GitHub] [kafka] showuon commented on a change in pull request #11022: KAFKA-13063: refactor DescribeConsumerGroupsHandler and tests

showuon commented on a change in pull request #11022:
URL: https://github.com/apache/kafka/pull/11022#discussion_r669487271



##########
File path: clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeConsumerGroupsHandler.java
##########
@@ -103,6 +104,12 @@ public String apiName() {
         return new DescribeGroupsRequest.Builder(data);
     }
 
+    private void validateGroupsNotEmpty(List<DescribedGroup> describedGroups) {
+        if (describedGroups.isEmpty()) {
+            throw new InvalidGroupIdException("No consumer group found");
+        }
+    }

Review comment:
       Before KIP-699, there's the check:
   ```java
   if (describedGroups.isEmpty()) {
             context.future().completeExceptionally(
                     new InvalidGroupIdException("No consumer group found for GroupId: " + context.groupId()));
             return;
         }
   ```
   But, you're right, the exception thrown will not return back to requester. Also, because there's no group found, we cannot have a failed key return because we need a group in key. 
   
   Removed it since it should never happen.




-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org