lianetm commented on code in PR #16673:
URL: https://github.com/apache/kafka/pull/16673#discussion_r1716963878


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1416,6 +1415,7 @@ public void assign(Collection<TopicPartition> partitions) 
{
             if (partitions == null) {
                 throw new IllegalArgumentException("Topic partitions 
collection to assign to cannot be null");
             }
+            subscriptions.validateAssignFromUserSubscriptionType();

Review Comment:
   do we need this validation here? This is already validated when the actual 
assignment attempt happens (when we call subscriptionState.assignFromUser in 
the appEventProcessor). I wonder if we could reuse that, and complete the event 
exceptionally if that call to assignFromUser fails? 
   
   I expect that then the addAndGet call here on ln 1448 would propagate the 
exception, so we would achieve the result we want, reusing the validation of 
the subscriptionState, and using the event as a way to propagate the result 
(successful or failed). Would that work?



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