Skip to content

Commit b32f369

Browse files
sunnyakaxdjeffwidman
authored andcommitted
Allow configurable timeouts in admin client check version
Currently there's no way to pass timeout to check_version if called from admin.
1 parent d09ff02 commit b32f369

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka/admin/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def __init__(self, **configs):
206206
self._client = KafkaClient(metrics=self._metrics,
207207
metric_group_prefix='admin',
208208
**self.config)
209-
self._client.check_version()
209+
self._client.check_version(timeout=(self.config['api_version_auto_timeout_ms'] / 1000))
210210

211211
# Get auto-discovered version from client if necessary
212212
if self.config['api_version'] is None:
@@ -273,7 +273,7 @@ def _refresh_controller_id(self):
273273
response = future.value
274274
controller_id = response.controller_id
275275
# verify the controller is new enough to support our requests
276-
controller_version = self._client.check_version(controller_id)
276+
controller_version = self._client.check_version(controller_id, timeout=(self.config['api_version_auto_timeout_ms'] / 1000))
277277
if controller_version < (0, 10, 0):
278278
raise IncompatibleBrokerVersion(
279279
"The controller appears to be running Kafka {}. KafkaAdminClient requires brokers >= 0.10.0.0."

0 commit comments

Comments
 (0)