Commit Graph

126 Commits (3d588323ff65045f1ca643f427eec237e9f14cc0)

Author SHA1 Message Date
David Wilson 81c8156965 Support LXD; closes #339. 6 years ago
David Wilson 22bab87821 issue #319: avoid TCSAFLUSH flag on WSL.
Closes #319.
6 years ago
David Wilson 56943d3141 issue #319: have cfsetraw() generate sensible flags.
Attempting to fix issue on WSL.

Closes #71
6 years ago
David Wilson 50a1bf6f22 issue #300: temporary workaround for shutdown issue.
Closes #300.
6 years ago
David Wilson 1171b06eb5 Merge remote-tracking branch 'origin/issue320' into dmw 6 years ago
David Wilson 76caf7d41d issue #320: ignore kqueue events marked KQ_EV_ERROR.
Since BasicStream.close() invokes _stop_transmit() followed by
os.close(), and KqueuePoller._stop_transmit() defers the unsubscription
until the IO loop resumes, kqueue generates an error event for the
associated FD, even though the changelist includes an unsubscription
command for the FD.

We could fix this by deferring close() until after the IO loop has run
once (simply by calling .defer()), but that generates extra wakeups for
no real reason.

Instead simply notice the error event and log it, rather than treating
it as a legitimate event.

Another approach to fixing this would be to process
_stop_receive()/_stop_transmit() eagerly, however that entails making
more syscalls.

Closes #320.
6 years ago
David Wilson f977be2868 issue #291: permit supplying a full Python argv. 6 years ago
David Wilson 336e90c5e3 parent: avoid needless quoting in Argv.
This just makes debug output a little more readable.
6 years ago
napkindrawing 745d72bb1d core: support for "doas" become_method 6 years ago
David Wilson 692275064b parent: fix TtyLogger str/unicode crash on 3.x. 6 years ago
David Wilson 29f15c236c core: remove needless size prefix from core_src_fd.
I think this is brainwrong held over from an early attempt to write the
duplicate copy of core_src on stdin.
6 years ago
David Wilson 8791d40081 parent: tidy up call_async() logging. 6 years ago
David Wilson 4ff47d6a93 parent: more 2/3x format fixes 6 years ago
David Wilson 6b4e047017 tests: 3.x parent_test fixes. 6 years ago
David Wilson 0422a8c263 parent: python_path setting depends on local or remote
For local, we want to default to the same Python version as the current
process. For remote, we want whatever is on offer.
6 years ago
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
6 years ago
David Wilson d6126a9516 issue #275: parent/ssh: centralize EC0_MARKER and change it for ssh.py.
Must maintain a minimum buffer length prior to deciding whether we have
an interesting token, and 'EC0' is too short for that.
6 years ago
David Wilson fbd5837cf2 issue #275: parent: use TIOCSCTTY on Linux too.
This appears to be harmless, except for Python 2.6 on Linux/Travis,
where for some reason (some stdlib change?) simply opening the TTY is
insufficient.
6 years ago
David Wilson cfd2887292 issue #275: default to 'python' for default remote interpreter.
So we get 2.4/2.5/2.6/2.7/3.x.
6 years ago
David Wilson 884a72ee86 issue #277: core: move Darwin versioner check into first stage
The 'versioner.c' dodging check added in 0ef23d86 was wrong, since the
check occurred on the host machine, when the fix actually needs to apply
to the Darwin target.

Fixes ability to target OS X from a Red Hat controller, manifesting as
an error like:

    D mitogen: mitogen.parent.TtyLogStream('local.2472'):  'python(mitogen:dmw@localhost.localdomain:2449): realpath couldn\'t resolve "/usr/bin/python(mitogen:dmw@localhost.localdomain:2449)"'

The "realpath couldn't resolve" error comes from versioner.c:

    https://opensource.apple.com/source/perl/perl-104/versioner/versioner.c
6 years ago
David Wilson 0e958ea177 issue #278: tty logger Side constructed with incorrect Stream
Harmless, but produced the wrong log message prefix.
6 years ago
David Wilson b58603c7a4 issue #278: ssh: support ssh_debug_level option and log TTY output.
Now debug logs may be captured all the way through the connection.
6 years ago
David Wilson 2fbe1f1b54 Get integration tests running under 2.6.
Closes #270
Closes #273
6 years ago
David Wilson 9e78c20eba core/parent: add Context.call_no_reply(). 6 years ago
David Wilson f7d2eace08 tests: importer fixes 6 years ago
David Wilson 9492dbc4d7 parent: split out minify.py and add stub where master can install it.
This needs a cleaner mechanism to install it, at least this one is
documented.
6 years ago
David Wilson 469bde63c2 parent: fix log message ordering 6 years ago
David Wilson 3f595bbc7e issue #213: use import_module() in parent.py.
This dynamic import crap really needs to be ripped out of parent.py
again. Static imports work much better for the module loader too.
6 years ago
David Wilson d2714752ee docs: tidy ups 6 years ago
David Wilson ddf28987a0 master: split Select() into new module to reduce wire size.
service.py currently imports master.py(+parent.py) just to get Select().
6 years ago
David Wilson 00edf0d66d core: have ExternalContext accept a config dict rather than kwargs.
The parameter lists had gotten out of control.
6 years ago
David Wilson 7d0209d8de issue #249: have upgrade_router() upgrade the poller too.
Now when a child becomes a parent, it gets a new poller suitable for
many more children than was possible using select().
6 years ago
David Wilson 6d18ce81d8 issue #249: restore duplex behaviour for epoll
With epoll() there is only one kernel-side object per file descriptor,
which is why _control() is such a pain. Since we merge receive/transmit
watching into that single object, we must always test the mask for both
conditions when reading results.

Kqueue isn't/doesn't appear to be like this. The identity of a Kqueue
event is keyed on (fd, filter), and we register a separate event for
both transmit and receive, so the 'elif' in KqueuePoller.poll() does not
appear to need to change.

Previously, a FD marked for read+write would not indicate writeability
until it was no longer readable.
6 years ago
David Wilson 6b98818046 issue #249: epoll distinguishes between hangup and disconnect
..typical Linux, for certain descriptor types only. So our receive mask
must match both, and normalize it into a read event like every other
poller.
6 years ago
David Wilson 36a1024861 issue #249: port Latch to poller too.
This is probably going to suck for perf :/
6 years ago
David Wilson 1070dfae72 issue #249: fix iter_read() regression. 6 years ago
David Wilson dcf0aa351e issue #249: whoops, fix new poller timeouts. 6 years ago
David Wilson aa8f786413 issue #249: fix Poller.from_existing() for v2 API 6 years ago
David Wilson 5645629e5d issue #249: the new pollers must handle syscall restarts too. 6 years ago
David Wilson 4df020827d issue #249: explicitly close pollers when done. 6 years ago
David Wilson 9905f6d8b4 issue #249: make write_all() and iter_read() use PREFERRED_POLLER. 6 years ago
David Wilson b6124f8396 issue #249: EpollPoller v2. 6 years ago
David Wilson 9abcf63155 issue #249: Poller API v2 (BSD only).
Now it's BasicStream/Side-agnostic, so it can be reused for Latch and
iter_read().
6 years ago
David Wilson 7320c542df issue #249: EpollPoller() for Linux. 6 years ago
David Wilson bc7be1879d issue #249: initial poller implementation (BSD only) 6 years ago
David Wilson d1a22cb5d4 issue #186: parent: implement FORWARD_MODULE.
To support detach, we must be able to preload the target with every
module it will need prior to detachment. This implements the
intermediary part of the process (i.e. the Ansible fork parent) --
receiving LOAD_MODULE/FORWARD_MODULE pairs and ensuring they reach the
child.
6 years ago
David Wilson d65e047b12 issue #179: ec0_receive() and connect_bootstrap() should use deadline.
Now there is a single global deadline derived from ansible.cfg timeout=
value.
6 years ago
David Wilson 356647bef4 issue #132: initial unidirectional routing mode. 6 years ago
David Wilson 7f1060f54a issue #186: initial version of subtree detachment. 6 years ago
David Wilson 8bd34e1e28 ansible: gracefully report connection timeouts as StreamError. 6 years ago