summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-08-13 10:40:48 -0700
committerGitHub <noreply@github.com>2017-08-13 10:40:48 -0700
commit422189bf04bd5cd8c76e8cbf9d48fd19a78e9ba9 (patch)
tree88d1d3b6685f1566d491c25520fda2912a3bb949
parent8cf44847bc91a986c98494c4a23be31c368ef4dd (diff)
downloadkafka-python-422189bf04bd5cd8c76e8cbf9d48fd19a78e9ba9.tar.gz
Select on sockets to avoid busy polling during bootstrap (#1175)
-rw-r--r--kafka/client_async.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py
index 5308c1f..ecd2cea 100644
--- a/kafka/client_async.py
+++ b/kafka/client_async.py
@@ -245,12 +245,14 @@ class KafkaClient(object):
**self.config)
bootstrap.connect()
while bootstrap.connecting():
+ self._selector.select(1)
bootstrap.connect()
if not bootstrap.connected():
bootstrap.close()
continue
future = bootstrap.send(metadata_request)
while not future.is_done:
+ self._selector.select(1)
bootstrap.recv()
if future.failed():
bootstrap.close()