summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Zhang <andrew.zhang@datadoghq.com>2023-03-02 15:25:13 -0500
committerGitHub <noreply@github.com>2023-03-02 12:25:13 -0800
commit7ac6c6e29099ccba4d50f5b842972dd7332d0e58 (patch)
tree4787cf483a0e8c1dfd3d2daf56f1af15ed759d05
parent4d598055dab7da99e41bfcceffa8462b32931cdd (diff)
downloadkafka-python-master.tar.gz
Allow disabling thread wakeup in send_request_to_node (#2335)HEADmaster
-rw-r--r--kafka/admin/client.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kafka/admin/client.py b/kafka/admin/client.py
index fd4d661..8eb7504 100644
--- a/kafka/admin/client.py
+++ b/kafka/admin/client.py
@@ -355,13 +355,14 @@ class KafkaAdminClient(object):
}
return groups_coordinators
- def _send_request_to_node(self, node_id, request):
+ def _send_request_to_node(self, node_id, request, wakeup=True):
"""Send a Kafka protocol message to a specific broker.
Returns a future that may be polled for status and results.
:param node_id: The broker id to which to send the message.
:param request: The message to send.
+ :param wakeup: Optional flag to disable thread-wakeup.
:return: A future object that may be polled for status and results.
:exception: The exception if the message could not be sent.
"""
@@ -369,7 +370,7 @@ class KafkaAdminClient(object):
# poll until the connection to broker is ready, otherwise send()
# will fail with NodeNotReadyError
self._client.poll()
- return self._client.send(node_id, request)
+ return self._client.send(node_id, request, wakeup)
def _send_request_to_controller(self, request):
"""Send a Kafka protocol message to the cluster controller.