From 7ac6c6e29099ccba4d50f5b842972dd7332d0e58 Mon Sep 17 00:00:00 2001 From: Andrew Zhang Date: Thu, 2 Mar 2023 15:25:13 -0500 Subject: Allow disabling thread wakeup in send_request_to_node (#2335) --- kafka/admin/client.py | 5 +++-- 1 file 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. -- cgit v1.2.1