1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
From: Stefano Rivera <stefanor@debian.org>
Date: Sun, 25 Sep 2022 13:09:28 +0200
Subject: Remove connection cleanup in destructor
It has been identified as a source of broken connections, when using
synchronize within loops. Hopefully this won't result in piled-up stale
connections...
Bug-Upstream: https://github.com/mitogen-hq/mitogen/issues/925
Bug-Debian: https://bugs.debian.org/1020622
Forwarded: no
---
ansible_mitogen/connection.py | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py
index 6df3dfc..aea4414 100644
--- a/ansible_mitogen/connection.py
+++ b/ansible_mitogen/connection.py
@@ -521,15 +521,6 @@ class Connection(ansible.plugins.connection.ConnectionBase):
# set by `_get_task_vars()` for interpreter discovery
_action = None
- def __del__(self):
- """
- Ansible cannot be trusted to always call close() e.g. the synchronize
- action constructs a local connection like this. So provide a destructor
- in the hopes of catching these cases.
- """
- # https://github.com/dw/mitogen/issues/140
- self.close()
-
def on_action_run(self, task_vars, delegate_to_hostname, loader_basedir):
"""
Invoked by ActionModuleMixin to indicate a new task is about to start
|