Commit Graph

117 Commits (ed71ae72f8f3d13c2e35ef08e1d72cd45c35bb4c)

Author SHA1 Message Date
David Wilson ed71ae72f8 master: make mitogen minimally functional under gevent
It seems gevent automatically sets blocking behaviour on fds produced by
the socket module, which causes the Python process we fork to fail
horribly. So in the child, always reset the blocking flag.
8 years ago
David Wilson 247f50e08d master: add comment 8 years ago
David Wilson bbcfc585a8 master: add a comment to explain what's going on, and fix log msg.
Closes #70
8 years ago
David Wilson 3cbe9baf6d issue #70: remove redundant 'raise SystemExit'
Either execvp succeeds, in which case the process image is replaced, or
execvp throws an exception, in which case control flow exits the frame
anyway.
8 years ago
David Wilson 326886832e Add license text everywhere. 8 years ago
David Wilson f1f36cec35 Simplify the API, make Broker optional and auto-shutdown on main thread exit. 8 years ago
David Wilson bbcf1a0bd4 Fix confusing return statements, closes #67. 8 years ago
Alex Willmer 3831ac360f Replace all calls to file() with open()
Although these are synonyms in Python 2.x, when using MyPy to typecheck
code use of file() causes spurious errors.

This commit also serves as one small step to Python 3.x compatibility,
since 3.x removes the file() builtin.
8 years ago
David Wilson c09dcd82a7 Fix Python 3 fix :/ closes #57 8 years ago
Alex Willmer 77d57a7e38 fakessh: Remove colon causing SyntaxError
fixes #58
8 years ago
David Wilson 658806bde8 fakessh: interruptible wait compatible with <2.7; closes #55 8 years ago
David Wilson b3491b190c master: Lazy-format more logging arguments, minor 3.x compat increments 8 years ago
Alex Willmer 0e7cc55e33 first stage: Remove/dedent else block
Since the above if block ends in a call to os.execv() this block will
only ever run when the if condition was false. Hence putting it in an
else clause is unnecessary.
8 years ago
Alex Willmer d1c10f64a5 first stage: Use string concatenation 8 years ago
Alex Willmer b490cde604 first stage: eliminate whitespace 8 years ago
Alex Willmer c7c0266e99 first stage: single letter variables 8 years ago
David Wilson 3d0e8c36d2 issue #49: 2.x/3.x compatible decode.
Much uglier command line, but it works across major Python releases.
8 years ago
David Wilson db9bec8720 Implement Alex's awesome idea of zlibbing the first stage too! Closes #49 8 years ago
David Wilson 0481c08beb Ensure _run_defer() fully executes at least once before shutdown
Without this, it's possible for Waker to be start_received() after the
shutdown signal has already been sent, resulting in 5 second delay
during shutdown.

Additionally mask EBADF during os.write() to waker's write side.
Necessary since nothing synchronizes writer threads from the broker
thread during shutdown. Could be done with a lock instead, but this is
cheaper.
8 years ago
David Wilson 828f60351b importer: Delete _get_module_via_parent entirely
Can't figure out what it's supposed to do any more, and can't find a
version of Ansible before August 2016 (when I wrote that code) that
seems to need it.

Add some more mitigations to avoid sending dylibs.
8 years ago
David Wilson b1ad04330b docs: move Router.route() into Sphinx. 8 years ago
David Wilson fb759f7c16 docs: move Broker docstrings into Sphinx. 8 years ago
David Wilson ffa063cc01 docs: annother barriage of cross-reference fixes. 8 years ago
David Wilson 7f3a58d514 core: Remove unused on_shutdown attribute. 8 years ago
David Wilson c9daa2ff30 docs: move fakessh docs into Sphinx. 8 years ago
David Wilson 6a10ab605e docs: move mitogen.utils docs to Sphinx. 8 years ago
David Wilson ec66152e37 docs: better io_op doc, move Side docs to Sphinx. 8 years ago
David Wilson 0767abf26f docs: move BasicStream docs into Sphinx. 8 years ago
David Wilson b7a9aa46cf core: More robust shutdown
Now there is a separate SHUTDOWN message that relies only on being
received by the broker thread, the main thread can be hung horribly and
the process will still eventually receive a SIGTERM.
8 years ago
David Wilson 3285fc2f75 Implement test_aborted_on_local_context_disconnect 8 years ago
David Wilson 690ee6dbe2 Fix select_test failure, remove crap old timing_test. 8 years ago
David Wilson 15bf0f54e2 Beginnings of module_finder_test 8 years ago
David Wilson 2454dcc990 core: loosen assertion to allow fakessh_test to succeed. 8 years ago
David Wilson 9b13a4cc61 Fix 2 call_function_test failures. 8 years ago
David Wilson 79dd00db5a master: hack to avoid executing __main__. 8 years ago
David Wilson 6f5d4882da We don't support sets, so don't use them in module loader(!) 8 years ago
David Wilson ecd39e4f2a add missing IOLOG, fixes _iter_read/SshTest. 8 years ago
David Wilson 451fb347d0 master: include related modules in ModuleResponder response 8 years ago
David Wilson 4af920094a iter_read: also treat 0-byte read as disconnection 8 years ago
David Wilson d169b55d64 select: fix typo 8 years ago
David Wilson af6812b458 Fix context naming for sudo and via=. 8 years ago
David Wilson f1d82c7284 More API documentation. 8 years ago
David Wilson b7f95e558f Better document Router API and constructors. 8 years ago
David Wilson 815f23bddd Sense of block= parameter was inverted. 8 years ago
David Wilson c4d9f124c6 Document Sender and Receiver classes. 8 years ago
David Wilson 849ccebe04 receiver: only permit one notify callback
There is no point spamming a list for every function call, there is no
use case where multiple notify callbacks would be useful.
8 years ago
David Wilson 1be10575a1 importer: Don't respond to non-.py[co] imports. 8 years ago
David Wilson 48bf987570 issue #20: fix queue.get() parameter list. 8 years ago
David Wilson f869e088f8 issue #20: tests and fixes for mitogen.master.Select(). 8 years ago
David Wilson e3d967ebeb issue #20: initial implementation of mitogen.master.Select(). 8 years ago