Commit Graph

622 Commits (113b747e153bc3f3ecd5d91f8410b9a3f9a1843f)
 

Author SHA1 Message Date
dw 9d1859796c
Merge pull request #83 from moreati/msg-in-a-jar
Fix lingering references to mitogen.core.Receiver.get_data()
7 years ago
dw fdb379ba0b
Merge pull request #81 from moreati/django-unfound
FIx syntax error in FindRelatedImportsTest.test_django_db_models
7 years ago
David Wilson 0d57afc914 master: use queue-like Latch in Select() too. 7 years ago
Alex Willmer 3bf204f8d6 docs: Fix out of date get_data() snippets
As of adc8fe3aed Receiver objects do not
have a get_data() method and Receiver.get() does not unpickle the
message.
7 years ago
Alex Willmer c1e29783fb Fix AttributeError in mitogen.core.Context.send_await()
As of adc8fe3aed Receiver objects do not
have a get_data() method and Receiver.get() does not unpickle the
message.
7 years ago
David Wilson 371a259a5e ansible: remove hard-wired UNIX socket path. 7 years ago
David Wilson a6324aaeb1 Latch v2: combined queue + one self-pipe-per-thread
Turns out it is far too easy to burn through available file descriptors,
so try something else: self-pipes are per thread, and only temporarily
associated with a Lack that wishes to sleep.

Reduce pointless locking by giving Latch its own queue, and removing
Queue.Queue() use in some places.

Temporarily undo merging of of Waker and Latch, let's do this one step
at a time.
7 years ago
Alex Willmer 83c0111b51 Fix TypeError while initiliazing ImporterMixin
Since f44356af32 mitogen.core.Importer()
takes a Router instance.
7 years ago
Alex Willmer 49b6c586e3 FIx syntax error in FindRelatedImportsTest.test_django_db_models 7 years ago
Alex Willmer 5ba2db0794 Split IterReadTest & WriteAllTest into test_parent
This matches their respective functions under test, which now reside in
mitogen.parent.
7 years ago
Alex Willmer f114c5951b Adjust unittest for master -> parent split
Tests should now match changes in
4d31300dd0
7 years ago
Alex Willmer 631c97b143 Fix indentation of Router.route anchor 7 years ago
David Wilson 8121530144 core: replace Queue with Latch
On Python 2.x, operations on pthread objects with a timeout set actually
cause internal polling. When polling fails to yield a positive result,
it quickly backs off to a 50ms loop, which results in a huge amount of
latency throughout.

Instead, give up using Queue.Queue.get(timeout=...) and replace it with
the UNIX self-pipe trick. Knocks another 45% off my.yml in the Ansible
examples directory against a local VM.

This has the potential to burn a *lot* of file descriptors, but hell,
it's not the 1940s any more, RAM is all but infinite. I can live with
that.

This gets things down to around 75ms per playbook step, still hunting
for additional sources of latency.
7 years ago
David Wilson 1c6e529458 ansible: delete old needless host_vars directory 7 years ago
David Wilson bb662a1a0b master: helper functions to force disconnect everything 7 years ago
David Wilson 4a431a1a85 service: initial version 7 years ago
David Wilson d3e79fc240 ansible: support become:True and become_user 7 years ago
David Wilson 2efb790a2f ansible: add become test case 7 years ago
David Wilson 3a96389d08 ansible: automatically configure connection plug-in. 7 years ago
David Wilson 8598ff07b3 ansible: restructure to avoid intermediate imports 7 years ago
David Wilson 1a119cb08b ansible: import example playbook 7 years ago
David Wilson 715e42a714 ansible: connection plugin v2
Now featuring one roundtrip per module invocation.
7 years ago
David Wilson 7819819188 core: CALL_FUNCTION should check auth_id, not src_id 7 years ago
David Wilson 5a04fbb694 ansible: Merge module runner into helpers.py. 7 years ago
David Wilson 1d5de9017f Remove old TCP draft. 7 years ago
David Wilson 3dd062bc18 issue #40: mitogen.unix initial implementation. 7 years ago
David Wilson aa1d58c9a3 fakessh: restore unpickle() semantics. 7 years ago
David Wilson dadee5dc05 docs: add Message documentation 7 years ago
David Wilson 424879dfb4 core: Message.reply() helper function 7 years ago
David Wilson 0a4711bce9 core: Don't crash if a stream is missing a side. 7 years ago
David Wilson 43c673b230 core: Restore behaviour of unpickling Router-specific Context subclass 7 years ago
David Wilson 8ef87bea6a select: clean up API. 7 years ago
David Wilson adc8fe3aed core: de-munge Message.unpickle() vs. Receiver.get(). 7 years ago
David Wilson c9affbaf50 core: add auth_id field. 7 years ago
David Wilson 01c607cc67 core: remove unused SecurityError. 7 years ago
David Wilson ddf4a21bac Add mitogen.main() decorator mainly for docs and demo use. 7 years ago
David Wilson 4121e9b35a issue #68: replace sets with lists
Fix a MyPy warning by only passing lists to select.select(). At least on
Python 2.x, select.select() was internally converting the sets to lists
anyway.

By the time lists become inefficient here, it is likely that
select.select() itself will also be inefficient, and need replaced with
.poll() or similar.

No discernible performance different when transferring django.db.models
to a local VM.
7 years ago
David Wilson 6897227a31 utils: support log_to_file(usec=True) 7 years ago
David Wilson 593e6e3261 importer: warn on duplicate request, simplify preload logic
* Children should never generate a request for a module that has already
  been sent, however there are a variety of edge cases where, e.g.
  asynchronous calls are made into unloaded modules in a set of
  children, causing those children to request modules (and deps) in a
  different order, which might break deduplication. So add a warning to
  catch when this happens, so we can figure out how to handle it.
  Meanwhile it's only a warning since in the worst case, this just adds
  needless latency.

* Don't bother treating sent packages separately, there doesn't seem to
  be any need for this (after docs are updated to match how preloading
  actually works now).
7 years ago
David Wilson 8765f761c9 importer: fix glaring bug in find_related()
Overwriting 'fullname' variable caused basically nonsensical filtering.
Result was including the module being searched in the list of
dependencies, which was causing ModuleResponder to send it early, which
was causing contexts to start importing the module before preloading of
dependencies had completed.
7 years ago
David Wilson e3d170904e importer: warn once about missing source and cache negative hit 7 years ago
David Wilson a19102a143 core: fix profiling
* SIGTERM safety net prevents profiler from writing results, so disable
  it when profiling is active.
* fix warning corrupting stream when profiling=True
7 years ago
David Wilson 4d31300dd0 Split up parent and master modules
Knocks 4kb off network footprint for a proxy connection.
7 years ago
David Wilson a8ad096d06 importer: always refuse builtins and __builtin__. 7 years ago
David Wilson b194e46d35 docs: reorder sections 7 years ago
David Wilson 0a2a483298 importer: new format to signal ImportError
Previously we'd send just None in GET_MODULE reply, but now since there
is no single request-reply structure, we must include the fullname in
the LOAD_MODULE response and make all of its data fields None to
indicate the same.
7 years ago
David Wilson 1acb068fb6 docs: remove obsolete warning 7 years ago
David Wilson bf5fbc9719 Merge branch 'wip-module-loader' 7 years ago
David Wilson 6715a1b150 importer: semi-functional preloader
Doesn't yet implement the rules in the docs, but I think the doc rules
could maybe change to match this. Needs lots of cleanup work and
thorough testing, but this is a great start.
7 years ago
David Wilson 76e4683ef1 docs: sphinx-autobuild default target. 7 years ago