kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: TRIVIAL: provide clearer error in describe group when group is inactive
Date Thu, 12 Nov 2015 17:07:44 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 2cf621884 -> d9a455243


TRIVIAL: provide clearer error in describe group when group is inactive

Author: Jason Gustafson <jason@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 <jason@confluent.io>
Authored: Thu Nov 12 09:13:51 2015 -0800
Committer: Guozhang Wang <wangguoz@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 =>


Mime
View raw message