[ https://issues.apache.org/jira/browse/KAFKA-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15861796#comment-15861796 ]
ASF GitHub Bot commented on KAFKA-2857: --------------------------------------- GitHub user vahidhashemian opened a pull request: https://github.com/apache/kafka/pull/2538 KAFKA-2857: Retry querying the consumer group while initializing This applies to new-consumer based groups and would avoid scenarios in which user issues a `--describe` query while the group is initializing. Example: The following could occur for a newly created group. ``` kafka@kafka:~/workspace/kafka$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group g Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers). Error: Executing consumer group command failed due to The group coordinator is not available. ``` With this PR the group is queried repeatedly at specific intervals within a preset (and configurable) timeout `group-init-timeout` to circumvent unfortunate situations like above. You can merge this pull request into a Git repository by running: $ git pull https://github.com/vahidhashemian/kafka KAFKA-2857 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/2538.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2538 ---- commit 1e801041793d47bff2f3a4414b4bb7c3dd27ad04 Author: Vahid Hashemian <vahidhashem...@us.ibm.com> Date: 2017-02-09T20:48:10Z KAFKA-2857: Retry querying the consumer group while the group initializes This applies to new-consumer based groups and would avoid scenarios in which user issues a `--describe` query while the group is stabilizing. Example: The following could occur for a newly created group. ``` kafka@kafka:~/workspace/kafka$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group g Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers). Error: Executing consumer group command failed due to The group coordinator is not available. ``` With this PR the group is queried repeatedly at specific intervals within a preset (and configurable) timeout `group-init-timeout` to circumvent unfortunate situations like above. ---- > ConsumerGroupCommand throws GroupCoordinatorNotAvailableException when > describing a non-existent group before the offset topic is created > ----------------------------------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-2857 > URL: https://issues.apache.org/jira/browse/KAFKA-2857 > Project: Kafka > Issue Type: Bug > Components: tools > Reporter: Ismael Juma > Assignee: Vahid Hashemian > Priority: Minor > > If we describe a non-existing group before the offset topic is created, like > the following: > {code} > bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --new-consumer > --describe --group gggg > {code} > We get the following error: > {code} > Error while executing consumer group command The group coordinator is not > available. > org.apache.kafka.common.errors.GroupCoordinatorNotAvailableException: The > group coordinator is not available. > {code} > The exception is thrown in the `adminClient.describeConsumerGroup` call. We > can't interpret this exception as meaning that the group doesn't exist > because it could also be thrown f all replicas for a offset topic partition > are down (as explained by Jun). > Jun also suggested that we should distinguish if a coordinator is not > available from the case where a coordinator doesn't exist. -- This message was sent by Atlassian JIRA (v6.3.15#6346)