-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Labels
DesignRequiredIssues that cannot progress due to incomplete designIssues that cannot progress due to incomplete designaffects-0.3Issues related to 0.3.X Mitogen releasesIssues related to 0.3.X Mitogen releases
Description
ansible_mitogen.planner.NewStylePlanner.ALWAYS_FORK_MODULES is a frozenset of Ansible module names (full qualified and unqualified) the Mitogen should treat as single-shot. The in-memory imported Python module cannot be reused, thus Mitogen must reinstantiate it each time.
mitogen/ansible_mitogen/planner.py
Lines 337 to 347 in 3656979
| #: Module names appearing in this set always require forking, usually due | |
| #: to some terminal leakage that cannot be worked around in any sane | |
| #: manner. | |
| ALWAYS_FORK_MODULES = frozenset([ | |
| 'dnf', # issue #280; py-dnf/hawkey need therapy | |
| 'firewalld', # issue #570: ansible module_utils caches dbus conn | |
| 'ansible.legacy.dnf', # issue #776 | |
| 'ansible.builtin.dnf', # issue #832 | |
| 'freeipa.ansible_freeipa.ipaautomember', # issue #1216 | |
| 'freeipa.ansible_freeipa.ipaautomountkey', | |
| 'freeipa.ansible_freeipa.ipaautomountlocation', |
Problems
- Bad name: ALWAYS_FORK describes an implementation detail, not the intent/purpose
- Bad API: exposes an implementation detail
- Brittle: the list is long, incomplete, and static
- High maintenance: fixing a particular instance requires a PR and release cycle
- Obscure: it is very unobvious that aparticular Ansible failure has any connection with ALWAYS_FORK_MODULES
Ideas
- Seal implementation behind methods/properties
- Fully qualify names before checking them (e.g.
dnfvsansible.legacy.dnfvsansible.builtin.dnf) - Make configurable (e.g. environment variable, Ansible plugin property)
- Mechanism for Ansible modules to declare themself multi or single shot (e.g. class attribute
mitogen_reuse = True|False|None) - Provide extension mechanism(s)
Metadata
Metadata
Assignees
Labels
DesignRequiredIssues that cannot progress due to incomplete designIssues that cannot progress due to incomplete designaffects-0.3Issues related to 0.3.X Mitogen releasesIssues related to 0.3.X Mitogen releases