summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2018-03-10 19:29:25 -0500
committerGitHub <noreply@github.com>2018-03-10 19:29:25 -0500
commit9998604ac21227821a2d0ac99b47940c0b142226 (patch)
tree1a26bb4e97456dd4e9f5f41242051656d34dd749
parentc920a2acd88bd3f3d755846378b56b10990720cd (diff)
downloadkafka-python-9998604ac21227821a2d0ac99b47940c0b142226.tar.gz
KAFKA-5512; Awake the heartbeat thread when timetoNextHeartbeat is equal to 0 (#1439)
-rw-r--r--kafka/coordinator/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py
index 57da971..bff6286 100644
--- a/kafka/coordinator/base.py
+++ b/kafka/coordinator/base.py
@@ -314,6 +314,10 @@ class BaseCoordinator(object):
cause = self._heartbeat_thread.failed
self._heartbeat_thread = None
raise cause # pylint: disable-msg=raising-bad-type
+
+ # Awake the heartbeat thread if needed
+ if self.heartbeat.should_heartbeat():
+ self._lock.notify()
self.heartbeat.poll()
def time_to_next_heartbeat(self):