Commit Graph

1242 Commits (410016ff479b717b2066cb3e1c673658d1ab43fe)
 

Author SHA1 Message Date
David Wilson 376fc85000 ansible: FileService docstrings. 7 years ago
David Wilson cf30e88a3e ansible: implement missing FileService.on_shutdown() 7 years ago
David Wilson 6541779dd6 tests: import Ansible file transfer benchmark 7 years ago
dw 9ec20086c2
Merge pull request #209 from dw/dmw
Streaming file transfer :D
7 years ago
David Wilson d2345d11e9 docs: remove warning labels. 7 years ago
David Wilson 5913be64d7 docs: remove last remaining major risk :D 7 years ago
David Wilson cb73c44084 ansible: implement streaming in Connection.put_file().
This is the function the copy module uses.
7 years ago
David Wilson 29087018c7 ansible: implement streaming in FileService.
This commit only uses it for the target.get_file() helper, which is only
used for transferring modules. The next commit wires it into the
Connection.transfer_file() API, which is the method the copy module
uses.
7 years ago
David Wilson 509ef14121 service: add an on_shutdown() callback. 7 years ago
David Wilson 4c5e13bf87 core: add Stream.pending_bytes() accessor. 7 years ago
dw e04f4f7e9d
Merge pull request #207 from dw/dmw
Move _DEAD into header, autogenerate dead messages
7 years ago
David Wilson 7c88e4d013 Move _DEAD into header, autogenerate dead messages
This change blocks off 2 common scenarios where a race condition is
upgraded to a hang, when the library could internally do better.

* Since we don't know whether the receiver of a `reply_to` is expecting
  a raw or pickled message, and since in the case of a raw reply, there
  is no way to signal "dead" to the receiver, override the reply_to
  field to explicitly mark a message as dead using a special handle.

  This replaces the serialized _DEAD sentinel value with a slightly
  neater interface, in the form of the reserved IS_DEAD handle, and
  enables an important subsequent change: when a context cannot route a
  message, it can send a generic 'dead' reply back towards the message
  source, ensuring any sleeping thread is woken with ChannelError.

  The use of this field could potentially be extended later on if
  additional flags are needed, but for now this seems to suffice.

* Teach Router._invoke() to reply with a dead message when it receives a
  message for an invalid local handle.

* Teach Router._async_route() to reply with a dead message when it
  receives an unroutable message.
7 years ago
dw daffa14b6e
Merge pull request #206 from dw/dmw
ansible: disable script interpreter processing for new-style
7 years ago
David Wilson 8c3b1fcf15 ansible: disable script interpreter processing for new-style
Re: #199
7 years ago
dw 1909fb43f5
Merge pull request #205 from dw/dmw
ansible: prevent Unicode strings leaking into sys.argv
7 years ago
David Wilson 2f02b5c0b1 ansible: prevent Unicode strings leaking into sys.argv
The module name comes from YAML via Jinja2.. it's always Unicode. Mixing
it into a temporary directory name produces a Unicode tempdir name,
which ends up in sys.argv via TemporaryArgv.
7 years ago
dw 0795b7dccc
Merge pull request #204 from dw/dmw
parent: don't wait for SIGTERM to complete.
7 years ago
David Wilson e56608ab91 parent: don't wait for SIGTERM to complete. 7 years ago
dw d58ac0280b
Merge pull request #203 from dw/dmw
Disconnection fixes
7 years ago
David Wilson dc4433ace6 issue #202: ansible: forget all dependent contexts on Stream disconnect
This is a partial fix, there are still at least 2 cases needing covered:

- In-progress connections must have CallError or similar sent to any
  waiters
- Once connection delegation exists, it is possible for other worker
  processes to be active (and in any step in the process), trying to
  communicate with a context that we know can no longer be communicated
  with. The solution to that isn't clear yet.

Additionally ensure root has /bin/bash shell in both Docker images.
7 years ago
David Wilson c5fe817db2 ansible: tidy up log repr slightly 7 years ago
David Wilson cbe6be449e issue #201: parent: log a warning and work around race for now. 7 years ago
David Wilson 9fe14e841c parent: reap the child process if connection fails
For example if no response is received in :attr:`connect_timeout`
seconds, the child would be left running.
7 years ago
dw 8f54fcfca4
Merge pull request #198 from dw/dmw
issue #195: handle non-ASCII scripts in runner.py.
7 years ago
David Wilson e7831a801f issue #195: handle non-ASCII scripts in runner.py. 7 years ago
dw c8b0f3585a
Merge pull request #197 from dw/dmw
MITOGEN_DUMP_THREAD_STACKS, better log integration, remove JobResultsService
7 years ago
David Wilson 85e1f5f515 ansible: remove JobResultService, more compatible async jobs; closes #191.
And by "compatible" I mean "terrible". This does not implement async job
timeouts, but I'm not going to bother, upstream async implementation is
so buggy and inconsistent it resists even having its behaviour captured
in tests.
7 years ago
David Wilson 6ad18b6719 issue #191: move async tests to their own category 7 years ago
David Wilson 296683b130 ansible: always display Mitogen errors and warnings.
They're no longer buried in -vvv output.
7 years ago
David Wilson 65fb6ff9fe issue #195: comment out stack pruning code 7 years ago
David Wilson 810f557514 issue #195: MITOGEN_DUMP_THREAD_STACKS=1 7 years ago
David Wilson f06ae05734 issue #195: add extra logging around FileService and get_file(). 7 years ago
dw 79fb65c5d6
Merge pull request #194 from dw/dmw
Implement hybrid TTY/socket mode
7 years ago
David Wilson 46a311165e issue #148: parent: prevent race in iter_read()
There is no guarantee on the ordering select() returns file descriptors.
So if, e.g. in the case of sudo_nonexistent.yml, sudo prints an error
to a single FD before exitting, there was previously no gurantee
iter_read() would read off the error before failing due to detecting
disconnect on any FD.

Now instead we keep reading while any non-disconnected FD exists.
7 years ago
David Wilson e43c6c531b Mostly implement hybrid TTY/socket mode for sudo and SSH.
Presently there is still no mechanism to add :attr:`tty_stream` to the
multiplexer after connection is successful, but for now it's not
expected that anything will be logged to it anyway.

Closes #148.
7 years ago
David Wilson fca22efe90 tests: enable profile_tasks callback plugin 7 years ago
dw 2e9fc93f8a
Merge pull request #193 from dw/dmw
Use subprocess to start child processes; closes #185.
7 years ago
David Wilson c6284e00e9 Use subprocess to start child processes; closes #185. 7 years ago
dw 22698715a8
Merge pull request #192 from dw/dmw
Enable initial regression tests in Travis
7 years ago
David Wilson bdc76c8231 parent: do not attempt to reap child twice. 7 years ago
David Wilson 1e882a72c0 tests: install virtualenv in the Docker images. 7 years ago
David Wilson b91785c9a1 tests: workaround for issue_109 7 years ago
David Wilson ce260933d9 tests: consistent play naming everywhere 7 years ago
David Wilson d827bdb848 tests: fixes to get regression/ running under vanilla Ansible 7 years ago
David Wilson b882b78d35 tests: clean up remaining reg tests
Delete some that are impossible to detect, fix up the remainder to
detect the condition they describe.
7 years ago
David Wilson aeeba54d96 tests: better regression test for issue #109 7 years ago
David Wilson 261f4397bb tests: rename debops mode, add extra centos/version targets 7 years ago
David Wilson 3f7dfd6344 tests: tidy up dross after fixing issue. 7 years ago
David Wilson f4d791662e ansible: better planner logging, try again 7 years ago
David Wilson b4bb1c5a2a tests: fix suspected readdir() ordering issue (!) 7 years ago