Skip to content

Commit f7367b8

Browse files
yzhan289hiwakaba
authored andcommitted
Allow disabling thread wakeup in send_request_to_node (dpkp#2335)
1 parent 4d59805 commit f7367b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kafka/admin/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,21 +355,22 @@ def _find_coordinator_ids(self, group_ids):
355355
}
356356
return groups_coordinators
357357

358-
def _send_request_to_node(self, node_id, request):
358+
def _send_request_to_node(self, node_id, request, wakeup=True):
359359
"""Send a Kafka protocol message to a specific broker.
360360
361361
Returns a future that may be polled for status and results.
362362
363363
:param node_id: The broker id to which to send the message.
364364
:param request: The message to send.
365+
:param wakeup: Optional flag to disable thread-wakeup.
365366
:return: A future object that may be polled for status and results.
366367
:exception: The exception if the message could not be sent.
367368
"""
368369
while not self._client.ready(node_id):
369370
# poll until the connection to broker is ready, otherwise send()
370371
# will fail with NodeNotReadyError
371372
self._client.poll()
372-
return self._client.send(node_id, request)
373+
return self._client.send(node_id, request, wakeup)
373374

374375
def _send_request_to_controller(self, request):
375376
"""Send a Kafka protocol message to the cluster controller.

0 commit comments

Comments
 (0)