diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-04-25 13:12:43 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-04-25 13:12:43 -0700 |
commit | 715bbb436e3c98c2ecb2be3593ce183c3ca72b5a (patch) | |
tree | e6423f7108a32de9ecf3c4fd404731b8177a2791 /kafka/coordinator/base.py | |
parent | 1bc2ce07782468eb4f244ad79a9784d10d5bc910 (diff) | |
download | kafka-python-715bbb436e3c98c2ecb2be3593ce183c3ca72b5a.tar.gz |
Avoid some exceptions in Coordinator.__del__ (#668)
Diffstat (limited to 'kafka/coordinator/base.py')
-rw-r--r-- | kafka/coordinator/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py index a4c25a3..168115a 100644 --- a/kafka/coordinator/base.py +++ b/kafka/coordinator/base.py @@ -89,7 +89,8 @@ class BaseCoordinator(object): #self.sensors = GroupCoordinatorMetrics(metrics, metric_group_prefix, metric_tags) def __del__(self): - self.heartbeat_task.disable() + if hasattr(self, 'heartbeat_task') and self.heartbeat_task: + self.heartbeat_task.disable() @abc.abstractmethod def protocol_type(self): |