Commit Graph

1038 Commits

Author SHA1 Message Date
David Wilson 2c141a741c tests: remove -vvv, Travis only does 4MB of log. 2018-05-04 18:13:58 +01:00
David Wilson ac9f416bc1 tests: make Ansible tests run again. 2018-05-04 18:00:18 +01:00
David Wilson 69f58875c8 tests: more ansible fixes from recent brakage. 2018-05-04 17:55:23 +01:00
David Wilson b20174729d issue #199: fix readonly_homedir test. 2018-05-04 17:43:06 +01:00
David Wilson f98279fc95 tests: fix LRU test after splitting up Connection class.
The module the connection class is now loaded as is
"ansible.plugins.connection.mitogen_ssh", etc., which breaks the test.
Instead, check if the connection is an instance of the base Connection
class.
2018-05-04 17:38:49 +01:00
David Wilson 42cc009b60 service: don't sleep on empty Select during shutdown.
Avoids a select error during random CTRL+C.
2018-05-04 17:12:52 +01:00
David Wilson ad1f624750 ansible: document and rearrange Runner params.
Move emulate_tty to where it's used.
2018-05-04 16:50:38 +01:00
David Wilson 1186b927f9 ansible: remove seemingly unused raw_params
Traced git log all the way back to beginning of time, and checked
Ansible versions starting Jan 2016. Zero clue where this came from, but
the convention suggests it came from Ansible at some point.
2018-05-04 16:35:35 +01:00
David Wilson f737ff5276 ansible: stop passing through remote_tmp variable
Ansiballz does not use remote_tmp so neither should we, per #239.
2018-05-04 15:30:51 +01:00
David Wilson f9e1905ec6 issue #199: ansible: stop writing temp files for new style modules
While adding support for non-new style module types, NewStyleRunner
began writing modules to a temporary file, and sys.argv was patched to
actually include the script filename. The argv change was never required
to fix any particular bug, and a search of the standard modules reveals
no argv users. Update argv[0] to be '', like an interactive interpreter
would have.

While fixing #210, new style runner began setting __file__ to the
temporary file path in order to allow apt.py to discover the Ansiballz
temporary directory. 5 out of 1,516 standard modules follow this
pattern, but in each case, none actually attempt to access __file__,
they just call dirname on it. Therefore do not write the contents of
file, simply set it to the path as it would exist, within a real
temporary directory.

Finally move temporary directory creation out of runner and into target.
Now a single directory exists for the duration of a run, and is emptied
by runner.py as necessary after each task invocation.

This could be further extended to stop rewriting non-new-style modules
in a with_items loop, but that's another step.

Finally the last bullet point in the documentation almost isn't a lie
again.
2018-05-04 06:16:25 +01:00
David Wilson 43e9e51ed6 docs: link signals into internals.rst. 2018-05-04 03:47:29 +01:00
David Wilson 1bc08323bf ansible: more compatible module script naming. 2018-05-04 01:50:48 +01:00
David Wilson 6109de51a0 tests: Ansible SSH timeout test
Also change Docker image to new 'mitogen' organization.
2018-05-03 18:19:40 +01:00
David Wilson 3058efc80f docs: more updates.
- accurate description of Ansible timeouts
- rough detach() sketch
2018-05-03 17:37:24 +01:00
David Wilson 7f1060f54a issue #186: initial version of subtree detachment. 2018-05-03 01:11:14 +01:00
David Wilson 8bd34e1e28 ansible: gracefully report connection timeouts as StreamError. 2018-05-03 00:06:51 +01:00
David Wilson c0e8b3d60a ssh: error wording was inaccurate. 2018-05-02 23:56:47 +01:00
David Wilson 8fc1eac6ae utils: combine MITOGEN_LOG_LEVEL and MITOGEN_LOG_IO.
Saves lots of readline fiddling.
2018-05-02 20:35:17 +01:00
David Wilson f5238fe791 docs: update copyright 2018-05-02 20:03:00 +01:00
David Wilson d3fe24a4f6 docs: update connection delegation example 2018-05-02 18:58:10 +01:00
David Wilson 2ee727f5c0 docs: typos and clarifications 2018-05-02 18:44:34 +01:00
David Wilson d4d4f46006 tests: update check_host_keys parameter style in testlib. 2018-05-02 17:59:23 +01:00
David Wilson e9990eb91c tests: Disable host key checking for debops. 2018-05-02 17:58:13 +01:00
David Wilson 4d1c6d2101 issue #127: ssh: reasonable solution to host key checking.
Ideally it would be possible to specify a callback function, but this is
not possible for proxied connections. So simply provide the 3 most
useful modes, defaulting to the most secure.

Closes #127. Closes #134.
2018-05-02 17:47:06 +01:00
David Wilson 92a2565507 issue #241: child main thread does not gracefully handle CTRL+C
In Ansible, depending on when CTRL+C is triggered, if it occurs after
the connection multiplexer process has forked, and after it has in turn
forked the "connection: local" context and its corresponding "clean fork
parent", since all the broker processes still belong to Ansible's
terminal foreground process group, they are all capable of receiving
SIGINT in response to CTRL+C being pressed on that terminal.

This papers over the problem. Really we want those KeyboardInterrupts to
be logged, to call setsid() frmo the connection multiplexer process to
isolate it from the terminal foreground process group. That way its only
indication of top-level process shutdown is using the graceful
disconnect mechanism that already exists in process.py::worker_main().
2018-05-02 16:56:26 +01:00
David Wilson 9cc8b21a07 ansible: missing mitogen_su module. 2018-05-02 16:41:35 +01:00
David Wilson b7fe0e09f4 tests: su integration test. 2018-05-02 06:28:10 +01:00
David Wilson 78c401ba4d ansible: support su become method. 2018-05-02 03:49:44 +01:00
David Wilson 3322eaef45 Basic "su" method. 2018-05-02 03:38:36 +01:00
David Wilson 79346d96db core: Allow dead messages to be delivered regardless of policy 2018-05-02 03:28:54 +01:00
David Wilson 3203846708 issue #239: ansible: ignore remote_tmp in new style runner. 2018-05-01 14:06:09 +01:00
David Wilson 94e048a2e5 ansible: ensure FileService uses exact CHUNK_SIZE multiple
9.8% throughput increase with sudo.
2018-05-01 01:57:17 +01:00
David Wilson 187e3a3fc1 ansible: support 2.3 too. 2018-04-30 19:15:51 +01:00
David Wilson dafe12b315 ansible: fix AnsibleUnicode crash when processing "~username". 2018-04-30 15:21:26 +01:00
David Wilson e1a3cea2f9 ansible: FileService: don't send empty last chunk 2018-04-30 01:24:59 +01:00
David Wilson 2a56c672ca ansible: FileService docstring updates. 2018-04-29 21:38:43 +01:00
David Wilson f5d22a3ca1 core: support deleting handlers, make Receiver.close() unregister 2018-04-29 19:41:23 +01:00
David Wilson 58eb9828b0 docs: remove limitation. 2018-04-29 19:35:43 +01:00
David Wilson 69e5902e61 issue #212: support explicit acknowledgements in FileService. 2018-04-29 19:30:57 +01:00
David Wilson 5e6e56f0c5 issue #212: service: make call_async kwargs optional. 2018-04-29 19:16:25 +01:00
David Wilson afe983d6c9 issue #212: service: support no_reply decorator. 2018-04-29 19:16:15 +01:00
David Wilson bf6c2fa97c issue #212: service: more concise repr 2018-04-29 19:16:03 +01:00
David Wilson ff7fb00569 parent: return latch to wait() caller to allow graceful timeout 2018-04-29 10:11:13 +01:00
David Wilson b0309b539c ansible: disable interpreter recycling for connections.
Must explicitly specify enable_lru=True in ContextService.get() to
trigger recycling.
2018-04-29 09:53:16 +01:00
David Wilson ec22fee7a7 docs: more ansible updates 2018-04-29 09:37:49 +01:00
David Wilson c0ced6d04a core: fix monster fork FD leak
_sockets only refers to the idle sockets list, it doesn't refer to every
socket currently in use by a Latch, for example, the 2*16 used by e.g.
Ansible's sleeping service pool.
2018-04-29 06:15:23 +01:00
David Wilson 7316c08237 core: fix _tls_init() race.
The GIL could be lost between the check for an empty list and popping a
socket off the list. Previously _tls_init (per its name) used per-thread
storage, hence the bug.
2018-04-29 06:03:40 +01:00
David Wilson 79fd35092b docs: more links 2018-04-29 04:00:11 +01:00
David Wilson fdac4ecce8 setns: typos 2018-04-29 02:55:28 +01:00
David Wilson 65e6a44fe7 docs: add links. 2018-04-29 02:31:32 +01:00