From df9cadcdc4bcec43b2358c3ae73206869d53d17a Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 16 Dec 2020 19:23:56 +0100 Subject: [PATCH] Handle AttributeError in etcd.py (#1801) When the__del__() method is executed the python interpreter already unloaded some of the modules that are still used down the http.clear() method. The only we could do in this case - silence some exceptions like ReferenceError, TypeError, AttributeError. Close https://github.com/zalando/patroni/issues/1785 --- patroni/dcs/etcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroni/dcs/etcd.py b/patroni/dcs/etcd.py index a7077be7..b6e20ba0 100644 --- a/patroni/dcs/etcd.py +++ b/patroni/dcs/etcd.py @@ -404,7 +404,7 @@ class EtcdClient(AbstractEtcdClientWithFailover): if self.http is not None: try: self.http.clear() - except (ReferenceError, TypeError): + except (ReferenceError, TypeError, AttributeError): pass def _prepare_get_members(self, etcd_nodes):