Skip to content

Commit

Permalink
Allow configurable timeouts in admin client check version
Browse files Browse the repository at this point in the history
Currently there's no way to pass timeout to check_version if called from admin.
  • Loading branch information
sunnyakaxd authored and jeffwidman committed Sep 17, 2020
1 parent d09ff02 commit b32f369
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kafka/admin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def __init__(self, **configs):
self._client = KafkaClient(metrics=self._metrics,
metric_group_prefix='admin',
**self.config)
self._client.check_version()
self._client.check_version(timeout=(self.config['api_version_auto_timeout_ms'] / 1000))

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

0 comments on commit b32f369

Please sign in to comment.