Skip to content

Commit 0edbaf9

Browse files
committed
Wakeup when there is a new node connection pending
1 parent 666b948 commit 0edbaf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kafka/client_async.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ def maybe_connect(self, node_id):
356356
"""Queues a node for asynchronous connection during the next .poll()"""
357357
if self._can_connect(node_id):
358358
self._connecting.add(node_id)
359+
# Wakeup signal is useful in case another thread is
360+
# blocked waiting for incoming network traffic while holding
361+
# the client lock in poll().
362+
self.wakeup()
359363
return True
360364
return False
361365

0 commit comments

Comments
 (0)