diff --git a/ansible_mitogen/runner.py b/ansible_mitogen/runner.py index 8da1b670..215a2d6d 100644 --- a/ansible_mitogen/runner.py +++ b/ansible_mitogen/runner.py @@ -358,6 +358,9 @@ class Runner(object): return path if self._temp_dir is None: + # Ensure that the temp directory is 'good' before we try to use it + ansible_mitogen.target.is_good_temp_dir(self.good_temp_dir) + self._temp_dir = tempfile.mkdtemp( prefix='ansible_mitogen_runner_', dir=self.good_temp_dir, diff --git a/docs/changelog.rst b/docs/changelog.rst index 0600ca3a..ca323cbf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,8 +20,7 @@ To avail of fixes in an unreleased version, please download a ZIP file Unreleased ---------- - - +* :gh:issue:`1061` Fix recreating temp directory if it has been removed mid-play v0.3.7 (2024-04-08) ------------------- @@ -58,7 +57,7 @@ v0.3.4 (2023-07-02) * :gh:issue:`929` Support Ansible 6 and ansible-core 2.13 * :gh:issue:`832` Fix runtime error when using the ansible.builtin.dnf module multiple times -* :gh:issue:`925` :class:`ansible_mitogen.connection.Connection` no longer tries to close the +* :gh:issue:`925` :class:`ansible_mitogen.connection.Connection` no longer tries to close the connection on destruction. This is expected to reduce cases of `mitogen.core.Error: An attempt was made to enqueue a message with a Broker that has already exitted`. However it may result in resource leaks.