diff options
author | Matt Clay <matt@mystile.com> | 2022-03-08 15:49:43 -0800 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2022-03-08 16:32:06 -0800 |
commit | 6f445ca6e5c9c8b85ccc5062e00508c69ca26fde (patch) | |
tree | dd64153629cf6da5164cc08ecf93b30fd5c8b9e6 /lib/ansible/executor | |
parent | f68c66a3ef2390d21f5eeb10bb6b151058570206 (diff) | |
download | ansible-6f445ca6e5c9c8b85ccc5062e00508c69ca26fde.tar.gz |
Remove obsolete Python 2.x controller code.
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r-- | lib/ansible/executor/process/worker.py | 6 | ||||
-rw-r--r-- | lib/ansible/executor/task_queue_manager.py | 16 |
2 files changed, 2 insertions, 20 deletions
diff --git a/lib/ansible/executor/process/worker.py b/lib/ansible/executor/process/worker.py index ee4164aa57..4e70a342ed 100644 --- a/lib/ansible/executor/process/worker.py +++ b/lib/ansible/executor/process/worker.py @@ -130,12 +130,10 @@ class WorkerProcess(multiprocessing_context.Process): # type: ignore[name-defin # shutdown. We have various ``Display`` calls that may fire from a fork # so we cannot do this early. Instead, this happens at the very end # to avoid that deadlock, by simply side stepping it. This should not be - # treated as a long term fix. Additionally this behavior only presents itself - # on Python3. Python2 does not exhibit the deadlock behavior. + # treated as a long term fix. # TODO: Evaluate overhauling ``Display`` to not write directly to stdout # and evaluate migrating away from the ``fork`` multiprocessing start method. - if sys.version_info[0] >= 3: - sys.stdout = sys.stderr = open(os.devnull, 'w') + sys.stdout = sys.stderr = open(os.devnull, 'w') def _run(self): ''' diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py index bc701e5062..8725a38059 100644 --- a/lib/ansible/executor/task_queue_manager.py +++ b/lib/ansible/executor/task_queue_manager.py @@ -338,22 +338,6 @@ class TaskQueueManager: self._final_q.close() self._cleanup_processes() - # A bug exists in Python 2.6 that causes an exception to be raised during - # interpreter shutdown. This is only an issue in our CI testing but we - # hit it frequently enough to add a small sleep to avoid the issue. - # This can be removed once we have split controller available in CI. - # - # Further information: - # Issue: https://bugs.python.org/issue4106 - # Fix: https://hg.python.org/cpython/rev/d316315a8781 - # - try: - if (2, 6) == (sys.version_info[0:2]): - time.sleep(0.0001) - except (IndexError, AttributeError): - # In case there is an issue getting the version info, don't raise an Exception - pass - def _cleanup_processes(self): if hasattr(self, '_workers'): for attempts_remaining in range(C.WORKER_SHUTDOWN_POLL_COUNT - 1, -1, -1): |