You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2015/11/12 18:07:44 UTC
kafka git commit: TRIVIAL: provide clearer error in describe group
when group is inactive
Repository: kafka
Updated Branches:
refs/heads/trunk 2cf621884 -> d9a455243
TRIVIAL: provide clearer error in describe group when group is inactive
Author: Jason Gustafson <ja...@confluent.io>
Reviewers: Guozhang Wang
Closes #502 from hachikuji/trivial-consumer-groups-fix
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d9a45524
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d9a45524
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d9a45524
Branch: refs/heads/trunk
Commit: d9a455243e2350a18b5c734f0a6edaeb74ac6698
Parents: 2cf6218
Author: Jason Gustafson <ja...@confluent.io>
Authored: Thu Nov 12 09:13:51 2015 -0800
Committer: Guozhang Wang <wa...@gmail.com>
Committed: Thu Nov 12 09:13:51 2015 -0800
----------------------------------------------------------------------
core/src/main/scala/kafka/admin/AdminClient.scala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/d9a45524/core/src/main/scala/kafka/admin/AdminClient.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/admin/AdminClient.scala b/core/src/main/scala/kafka/admin/AdminClient.scala
index 28f3cda..ff1d3fe 100644
--- a/core/src/main/scala/kafka/admin/AdminClient.scala
+++ b/core/src/main/scala/kafka/admin/AdminClient.scala
@@ -155,8 +155,11 @@ class AdminClient(val time: Time,
def describeConsumerGroup(groupId: String): List[ConsumerSummary] = {
val group = describeGroup(groupId)
+ if (group.state == "Dead")
+ return List.empty[ConsumerSummary]
+
if (group.protocolType != ConsumerProtocol.PROTOCOL_TYPE)
- throw new IllegalArgumentException(s"Group ${groupId} is not a valid kafka consumer group but belongs to ${if (!group.protocolType.isEmpty) group.protocolType else "not exist"}")
+ throw new IllegalArgumentException(s"Group ${groupId} with protocol type '${group.protocolType}' is not a valid consumer group")
group.members.map {
case member =>