Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions kafka/admin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from kafka.errors import (
IncompatibleBrokerVersion, KafkaConfigurationError, UnknownTopicOrPartitionError,
UnrecognizedBrokerVersion, IllegalArgumentError)
from kafka.future import Future
from kafka.metrics import MetricConfig, Metrics
from kafka.protocol.admin import (
CreateTopicsRequest, DeleteTopicsRequest, DescribeConfigsRequest, AlterConfigsRequest, CreatePartitionsRequest,
Expand Down Expand Up @@ -358,14 +359,11 @@ def _send_request_to_node(self, node_id, request, wakeup=True):

Returns:
A future object that may be polled for status and results.

Raises:
The exception if the message could not be sent.
"""
while not self._client.ready(node_id):
# poll until the connection to broker is ready, otherwise send()
# will fail with NodeNotReadyError
self._client.poll(timeout_ms=200)
try:
self._client.await_ready(node_id)
except Errors.KafkaConnectionError as e:
return Future().failure(e)
return self._client.send(node_id, request, wakeup)

def _send_request_to_controller(self, request):
Expand Down
Loading