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
This commit is contained in:
Alexander Kukushkin
2020-12-16 19:23:56 +01:00
committed by GitHub
parent 9b263dc6c9
commit df9cadcdc4
+1 -1
View File
@@ -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):