diff options
| author | Dana Powers <dana.powers@rd.io> | 2018-03-10 14:15:12 -0500 |
|---|---|---|
| committer | Dana Powers <dana.powers@rd.io> | 2018-03-10 16:27:24 -0500 |
| commit | 9091250d93c9aefc50c863a60c7c9d3a8d446122 (patch) | |
| tree | a3927e5fafd51200b491290b87d4629b28932ffd | |
| parent | ec9049c60794785ab6c7babc90759678e665ccd8 (diff) | |
| download | kafka-python-KAFKA_5512_notify_heartbeat_thread.tar.gz | |
KAFKA-5512; Awake the heartbeat thread when timetoNextHeartbeat is equal to 0KAFKA_5512_notify_heartbeat_thread
| -rw-r--r-- | kafka/coordinator/base.py | 4 |
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): |
