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/03/18 14:29:02 UTC

[GitHub] [kafka] unlizhao edited a comment on pull request #10348: MINOR: KafkaAdminClient check null for group.groupState()

unlizhao edited a comment on pull request #10348:
URL: https://github.com/apache/kafka/pull/10348#issuecomment-801972726


   @dajac  Thanks for your reviewed.  
   
   Normally, this value(`group.groupState()`) is the network request processed by the customer in the cluster when sending the consumergroups message. Normally, the response will carry this value.
   
   If this value is not set, `group.groupStat ()` will be a null. This way of writing `group.groupState().Equals (‘’)` will report null pointer exception.
   
   You can try to do this and you'll see this.` org.apache.kafka . clients.admin.KafkaAdminClientTest#testListConsumerGroupsWithStates`
   
   `Change to setgroupstate ("stable") ==> setgroupstate (null)`
   
   However, according to the normal design, the `response` without `groupstate` itself is illegal, and it is reasonable not to handle this response.
   
   Even if NPE occurs, this method is in the outer try catch and will not cause system crash.


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

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