Skip to content

Commit 72c1969

Browse files
authored
Fix spec for GroupCoordinatorResponse_v1 (#961)
1 parent 8f7bff0 commit 72c1969

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

aiokafka/admin/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AIOKafkaAdminClient:
4646
each request to servers and can be used to identify specific
4747
server-side log entries that correspond to this client. Also
4848
submitted to GroupCoordinator for logging with respect to
49-
consumer group administration. Default: 'kafka-python-{version}'
49+
consumer group administration. Default: 'aiokafka-{version}'
5050
request_timeout_ms (int): Client request timeout in milliseconds.
5151
Default: 40000.
5252
connections_max_idle_ms: Close idle connections after the number of
@@ -508,10 +508,7 @@ async def find_coordinator(self, group_id: str, coordinator_type: int = 0) -> in
508508
509509
:return int: the acting coordinator broker id
510510
"""
511-
# FIXME GroupCoordinatorRequest_v1 in kafka-python 2.0.2 doesn't match
512-
# spec causing "ValueError: Buffer underrun decoding string"
513-
# version = self._matching_api_version(GroupCoordinatorRequest)
514-
version = self._matching_api_version(GroupCoordinatorRequest[:1])
511+
version = self._matching_api_version(GroupCoordinatorRequest)
515512
if version == 0 and coordinator_type:
516513
raise IncompatibleBrokerVersion(
517514
"Cannot query for transaction id on current broker version"

aiokafka/protocol/commit.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class GroupCoordinatorResponse_v1(Response):
280280
API_KEY = 10
281281
API_VERSION = 1
282282
SCHEMA = Schema(
283+
("throttle_time_ms", Int32),
283284
("error_code", Int16),
284285
("error_message", String("utf-8")),
285286
("coordinator_id", Int32),
@@ -292,14 +293,19 @@ class GroupCoordinatorRequest_v0(Request):
292293
API_KEY = 10
293294
API_VERSION = 0
294295
RESPONSE_TYPE = GroupCoordinatorResponse_v0
295-
SCHEMA = Schema(("consumer_group", String("utf-8")))
296+
SCHEMA = Schema(
297+
("consumer_group", String("utf-8")),
298+
)
296299

297300

298301
class GroupCoordinatorRequest_v1(Request):
299302
API_KEY = 10
300303
API_VERSION = 1
301304
RESPONSE_TYPE = GroupCoordinatorResponse_v1
302-
SCHEMA = Schema(("coordinator_key", String("utf-8")), ("coordinator_type", Int8))
305+
SCHEMA = Schema(
306+
("coordinator_key", String("utf-8")),
307+
("coordinator_type", Int8),
308+
)
303309

304310

305311
GroupCoordinatorRequest = [GroupCoordinatorRequest_v0, GroupCoordinatorRequest_v1]

0 commit comments

Comments
 (0)