Commit Graph

623 Commits (175fc377d267cd8308cebfbb2b6e02985bd51f8e)

Author SHA1 Message Date
David Wilson 375182b71b issue #406: don't leak side FDs on bootstrap failure. 7 years ago
David Wilson 14b389cb46 issue #406: don't leak FDs on failed child start. 7 years ago
David Wilson d1c2e7a834 issue #406: call Poller.close() during broker shutdown. 7 years ago
David Wilson e4280dc14a core: Don't crash in Waker.__repr__ if partially initialized. 7 years ago
David Wilson 87e8c45f76 core: fix minify_test regression introduced in 804bacdadb
The minifier can't handle empty function bodies, so the pass statements
are necessary.
7 years ago
David Wilson 16c364910a core: avoid redundant write() calls in Waker.defer()
Using _lock we can know for certain whether the Broker has received a
wakeup byte yet. If it has, we can skip the wasted system call.

Now on_receive() can exactly read the single byte that can possibly
exist (modulo FD sharing bugs -- this could be improved on later)
7 years ago
David Wilson 8e4c164d93 issue #388: fix Sphinx markup 7 years ago
David Wilson 804bacdadb docs: move most remaining docstrings back into *.py; closes #388
The remaining ones are decorators which don't seem to have an autodoc
equivlent.
7 years ago
David Wilson 711aed7a4c core: split _broker_shutdown() out into its own function.
Makes _broker_main() logic much clearer.
7 years ago
David Wilson 1d32ed3b5a core: avoid shutdown() in IoLogger on WSL; closes #333. 7 years ago
David Wilson 07fefa4067 kubectl: paper over importer issue by removing unicode. 7 years ago
David Wilson 5be9a55bf4 core: allow Context to be pickled by non-Mitogen pickler. 7 years ago
David Wilson f2d288bb1e tests: ensure minify() result can be compiled for all of core. 7 years ago
David Wilson a7ee23719a issue #388: move a ton of documentation back into the source 7 years ago
David Wilson fadb9181bc issue #410: support sudo --user and SELinux options, add stub test. 7 years ago
David Wilson 0394dac2c7 docs: document RouteMonitor class. 7 years ago
David Wilson 71f9e84ab3 Add EOF error hints for LXC/LXD; closes #373. 7 years ago
David Wilson 22b4b186d7 issue #333: add versioning to EpollPoller too. 7 years ago
David Wilson 73cda2994f issue #333: add versioning, initial batch of poller tests
Now poller is start enough to know a start_receive() during an iteration
does not cause events yielded by that iteration to associate with the
wrong descriptor.

These changes are tangentially related to the associated ticket, but
event versioning is still the underlying issue.
7 years ago
David Wilson 1cbff1011e core: send dead message if max message size exceeded; closes #405 7 years ago
David Wilson 1eae594e32 ssh: fix check_host_keys="accept" and test; closes #411
Add real accept/enforce tests.
7 years ago
David Wilson 16ca111ebd ssh: better OpenSSH 7.5+ permission denied handling
The user@host prefix in new-style OpenSSH messages unfortunately takes
the host part from ~/.ssh/config and friends. There is no way to know
which hostname will appear in this string without parsing the OpenSSH
config, nor which username will appear.

Instead just regex it.

Add SSH stub modes to print the new/old errors and add some simple
tests.

This extends the work done in b9112a9cbb
7 years ago
David Wilson 9ec360c26d core: split out & extend Broker.sync_call() 7 years ago
David Wilson f343bbba3a unix: fix exception catch on 3.x. 7 years ago
David Wilson 0d04e940b7 master: docstring fixes. 7 years ago
David Wilson 4e3830d75e tests: add basic unix_test.py. 7 years ago
David Wilson 58d0a45738 issue #76: quieten routing errors.
Receiving DEL_ROUTE without a corresponding ADD_ROUTE is now legit
behaviour, so don't print an error in this case.

Don't print an error for dropped messages if the reply_to indicates the
sender doesn't care about a response (dead and no_reply)
7 years ago
David Wilson fba52a0edf issue #76: add API for ansible_mitogen to get route list
Earlier commit moved Stream.routes attribute into a private map
belonging to RouteMonitor, to make upgrades smoother. This adds a new
accessor method to RouteMonitor.
7 years ago
David Wilson 431051f69b issue #76: parent: broadcast DEL_ROUTE to interested parties
Now rather than simply propagate DEL_ROUTE upwards towards the parent,
we broadcast it downward to any stream that ever sent a message toward
any of the routes that have just become disconnected.
7 years ago
David Wilson b9bafb78af issue #76: add stub DEL_ROUTE handler to core.py.
This handler knows how to fire 'disconnect' event on reception of a
DEL_ROUTE, and nothing more.
7 years ago
David Wilson babe3eec31 issue #76: record egress context IDs
Used in a subsequent change to broadcast DEL_ROUTE to potentially
interested children.
7 years ago
David Wilson d7d40f1123 issue #76: reduce Context duplication during unpickling
When unpickling a context, arrange for there to be a single instance
representing that context, managed by the corresponding router. This
context_by_id() was already in use by parent.py, it just needs to move
down.

This to eventually reach the point where a single Context exists that
needs 'disconnect' fired on it, so all sleeping receivers are definitely
woken.
7 years ago
David Wilson cfcc7c0273 Bump version for release. 7 years ago
David Wilson 9828588e97 master: group is_stdlib_name() with other module functions. 7 years ago
David Wilson bf597d257f master: document LogForwarder. 7 years ago
David Wilson 74cf9c3c96 master: document ThreadWatcher 7 years ago
David Wilson a7b1831ddf core: move IS_DEAD doc into core.py. 7 years ago
David Wilson 3aa5c4c53d issue #373: parse the child process wait status
Don't log the raw waitpid() result, convert it to a useful string first.
7 years ago
dw ad44ad16f1
Merge pull request #385 from moreati/python-3.x-cleanups
Test with Tox on Python 3.x
7 years ago
Alex Willmer 6da31c9dee docs: Remove unneeded backslash escapes
Python 3.x was emitting a DeprecationWarning. AFAICT there has been no
impact on the HTML rendering.
7 years ago
Alex Willmer b9112a9cbb ssh: Fix password authentication with Python 3.x & OpenSSH 7.5+
Since PERMDENIED_PROMPT is a byte string the interpolation was resulting
in: b"user@host: b'permission denied'". Needless to say this didn't
match.
7 years ago
David Wilson 0fa5fe5559 parent: handle masters with blank sys.executable; closes #356. 7 years ago
David Wilson 4c81eba599 Merge commit 'refs/pull/377/head' of github.com:dw/mitogen into dmw
(Pull #377)

Changes:
- additional_parameters -> extra_args
- Merge with kubectl changes from dmw branch
- Update docs
- Remove unused username class member
- Avoid mutable kubectl_args class member
- Use six.iteritems
7 years ago
David Wilson 4146648759 master: log error an refuse __main__ import if no guard detected.
Closes #366.
7 years ago
David Wilson f6b201bdfc docs: updates for #376 and #371 7 years ago
Yannig Perré 17548d1e49 [Enhancement] handle kubectl vars from Ansible connector.
This change allows the kubectl connector to support the same options as
Ansible's original connector.

The playbook sample comes with an example of a pod containing two containers
and checking that moving from one container to another, the version of Python
changes as expected.
7 years ago
Alex Willmer 2c2878012d Match "user@host: Permission denied ..." messages
OpenSSH 7.5 changed the text of the permission denied message. As a
result ssh_test.SshTest.test_password_required and test_pubkey_required
were failing on an Ubuntu 18.04 client, which ships OpenSSH 7.6.

Refs
- https://bugzilla.mindrot.org/show_bug.cgi?id=2720
7 years ago
dw 4356fdf027
Merge pull request #376 from Yannig/kubectl
Kubernetes connection support for mitogen.
7 years ago
Yannig Perré 6828926a36 Kubernetes connection support for mitogen. 7 years ago
Brian Candler d1c84552ec Use `lxc exec --mode=noninteractive` which is more widely compatible
Closes #371
7 years ago