Commit Graph

520 Commits (c959ce010b123a19cbd65118c2a4bd7a8af3d3ef)

Author SHA1 Message Date
Steven Robertson c959ce010b created temp action obj for 'meta: reset_connection' python interpreter discovery 5 years ago
Steven Robertson 5b8c9da769 _execute_meta doesn't have an Action nooooo this breaks 'meta: reset_connection' because interpreter_discovery needs an Action 5 years ago
Steven Robertson 33e7d0804f fixed tests, and removed the action hack code 5 years ago
Steven Robertson 7411057ba8 adding in python3 as a possible_pythons option for rhel8 5 years ago
Steven Robertson 89d87445c8 able to pass tests running interpreter detection in rhel8 container 5 years ago
Steven Robertson 7d6d76e444 trying to get docker rhel8 working on a Mac host 5 years ago
Steven Robertson 5e0fb902b2 fix lambda args for fallback 5 years ago
Steven Robertson 91785f8862 fix another bad import 5 years ago
Steven Robertson ee310c1a68 remove_internal_keys returns None, so need different way to check fallback 5 years ago
Steven Robertson 722cf0ea8d handle ansible 2.3.3 remove_internal_keys 5 years ago
Steven Robertson cf1c3aac1c fix typo 5 years ago
Steven Robertson ba350aa6cf assigned interpreter vars to the wrong class 5 years ago
Steven Robertson d74da84f62 the clean module was added later 5 years ago
Steven Robertson 496d96c01a need to convert to str because of unicode_literals 5 years ago
Steven Robertson aa0ad5ce8f accidentally broke discovery 5 years ago
Steven Robertson 160dbd86b4 keeping track of interpreter discovery vars in case of ansible < 2.8 5 years ago
Steven Robertson f10fb7d486 more test cases pass 5 years ago
Steven Robertson e3eebb98d0 ImportError instead of newer ModuleNotFoundError 5 years ago
Steven Robertson 2d3d9cb659 fallback to old-style python interpreter default if running ansible < 2.8.0 5 years ago
Steven Robertson ff2fa60184 fixed typo 5 years ago
Steven Robertson 0b57332d75 all test cases for ansible_python_interpreter on OSX pass now 5 years ago
Steven Robertson 81694d07ab fix typo 5 years ago
Steven Robertson 8630f6190c fixed propagating discovered interpreter to future tasks; sys.executable still wrong though 5 years ago
Steven Robertson af1e22d4e1 able to propagate ansible_python_interpreter fact but still doesn't save between task runs 5 years ago
Steven Robertson 119e1c24aa code cleanup 5 years ago
Steven Robertson cec692dc17 faking pipelining so discover_interpreter can successfully exit 5 years ago
Steven Robertson a6d2b2cd90 doesn't error when declaring 'ansible_python_interpreter: auto' but fact isn't being cached 5 years ago
Steven Robertson 19ba2417c8 now able to get the action object, but recursion error in low_level_exec_command 5 years ago
Steven Robertson 806651e112 working on ansible discovery; need to fix passing ActionModuleMixin reference still 5 years ago
Steven Robertson d64adb15d7 reverted autolinted code 5 years ago
Steven Robertson e8f3154cab Merge branch 'master' into complexAnsiblePythonInterpreterArg 5 years ago
David Wilson d6329f3446 Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 5 years ago
Steven Robertson 4669c8774f handles templating ansible_python_interpreter values 5 years ago
Steven Robertson cc11864b7d code cleanup 5 years ago
Steven Robertson 24b170311a able to get to 'sudo: source not found' after preventing escape of && so python connects 5 years ago
David Wilson be4f1bdb50 issue #646: add extra logging to assertions and start_child() 5 years ago
David Wilson efd82dd35a issue #633: various task_vars fixes
- take host_vars from task_vars too
- make missing task_vars a hard error
- update tests to provide stub task_vars
5 years ago
David Wilson fc09b81949 issue #633: handle meta: reset_connection when become is active
- don't create a new connection during reset if no existing connection
  exists
- strip off last hop in connection stack if PlayContext.become is True.
- log a debug message if reset cannot find an existing connection
5 years ago
David Wilson b6d1df749c issue #633: take inventory_hostname from task_vars
It used to be set by on_action_run() from task_vars, but this doesn't
work for meta: reset_connection. That meant MITOGEN_CPU_COUNT>1 would
pick the wrong mux to reset the connection on.
5 years ago
David Wilson f4cf67f0bd issue #615: remove meaningless test
It has been dead code since at least 2015
5 years ago
David Wilson e02be89879 issue #625: ignore SIGINT within MuxProcess
Without this, MuxProcess will start dying too early, before Ansible /
TaskQueueManager.cleanup() has a chance to wait on worker processes.
That would allow WorkerProcess to see ECONNREFUSED from the MuxProcess
socket much more easily.
5 years ago
David Wilson 67759371f9 issue #615: ensure 4GB max_message_size is configured for task workers.
This 4GB limit was already set for MuxProcess and inherited by all
descendents including the context running on the target host, but it was
not applied to the WorkerProcess router.

That explains why the error from the ticket is being raised by the
router within the WorkerProcess rather than the router on the original
target.
5 years ago
David Wilson 151b490890 issue #615: fetch_file() might be called with AnsibleUnicode. 5 years ago
David Wilson 03d2bc6c59 issue #615: redirect 'fetch' action to 'mitogen_fetch'. 5 years ago
David Wilson 52c8ed7715 issue #615: extricate slurp brainwrong from mitogen_fetch 5 years ago
David Wilson 069285a588 issue #615: ansible: import Ansible fetch.py action plug-in
From ansible/ansible#9773a1f2896a914d237cb9926e3b5cdc0f004d1a
5 years ago
David Wilson 8dfb3966df issue #558, #582: preserve remote tmpdir if caller did not supply one
The undocumented 'tmp' parameter controls whether _execute_module()
would delete anything on 2.3, so mimic that. This means
_execute_remove_stat() calls will not blow away the temp directory,
which broke the unarchive plugin.
5 years ago
David Wilson 3b63da670f Fix up another handful of LGTM errors. 5 years ago
David Wilson f78a5f08c6 issue #605: ansible: share a sem_t instead of a pthread_mutex_t
The previous version quite reliably causes worker deadlocks within 10
minutes running:

    # 100 times:
    - import_playbook: integration/async/runner_one_job.yml
    # 100 times:
    - import_playbook: integration/module_utils/adjacent_to_playbook.yml

via .ci/soak/mitogen.sh with PLAYBOOK= set to the above playbook.

Attaching to the worker with gdb reveals it in an instruction
immediately following a futex() call, which likely returned EINTR due to
attaching gdb. Examining the pthread_mutex_t state reveals it to be
completely unlocked.

pthread_mutex_t on Linux should have zero trouble living in shmem, so
it's not clear how this deadlock is happening. Meanwhile POSIX
semaphores are explicitly designed for cross-process use and have a
completely different internal implementation, so try those instead. 1
hour of soaking reveals no deadlock.

This is about avoiding managing a lockable temporary file on disk to
contain our counter, and somehow communicating a reference to it into
subprocesses (despite the subprocess module closing inherited fds, etc),
somehow deleting it reliably at exit, and somehow avoiding concurrent
Ansible runs stepping on the same file. For now ctypes is still less
pain.

A final possibility would be to abandon a shared counter and instead
pick a CPU based on the hash of e.g. the new child's process ID. That
would likely balance equally well, and might be worth exploring when
making this code work on BSD.
5 years ago
David Wilson 5af6c9b26f issue #615: use FileService for target->controll file transfers 5 years ago