David Wilson
0db472c97b
Fix up importer_test.
7 years ago
David Wilson
2092568e7c
issue #19 : whoops, implement sliding window properly
7 years ago
David Wilson
231a300649
issue #19 : second attempt at import scanner
...
This version is based on the modulefinder standard library module,
pruned back just to handle modules we know have been loaded already, and
to scan module-level imports only, rather than imports occurring in
class and function scope (crappy heuristic, but assume they are lazy
imports).
The ast and compiler modules were far too slow, whereas this version can
bytecode compile and scan all the imports for django.db.models (58
modules) in around 200ms.. 3.4ms per dependency, it's probably not going
to get much faster than that.
7 years ago
David Wilson
55bdb50d4f
Add README.md to tests subdir.
7 years ago
David Wilson
60ed8525b0
Fix inverted logic.
7 years ago
David Wilson
d553295135
Syntax error.
7 years ago
David Wilson
ea3404ce21
Only import compiler when necessary, it's not available in 3.x.
7 years ago
dw
a8d1dc6730
Merge pull request #35 from moreati/pylint
...
Fix some PyLint errors
7 years ago
Alex Willmer
c854bec6f6
Handle failure to import the ast module
7 years ago
David Wilson
57de31344b
core: use an output deque rather than string to improve worst case perf
...
This probably worsens performance in the common case, but it prevents
runaway producers (see e.g. issue #36 ) from spending all their CPU
copying around huge strings.
It's also a small step towards a solution to issue #6 , which will
replace the output buffer with some sort of fancier queue anyway.
This reduces a particular 40 second run of rsync to 1.5 seconds.
7 years ago
David Wilson
22dcbf9e48
Document Router.profiling.
7 years ago
Alex Willmer
81fe37b108
Fix stale references to m.master.connect & m.ssh.connect
...
I'm fairly sure these updates are correct, but I'm not able to run the
test suite to confirm.
7 years ago
Alex Willmer
a8d216eeab
Update lingering references to with_broker & run_with_broker
...
A previous commit renamed run_with_broker() and with_broker() to
run_with_router() and with_router() respctively. Some references were
missed.
7 years ago
Alex Willmer
794a8a7a07
Add missing LOG import
...
Fixes an undefined variable error found by pylint
7 years ago
Alex Willmer
0384e6189c
Use fully qualified Context
...
Fixes an undefined variable error found by pylint
7 years ago
Alex Willmer
8ac45565a5
Add missing import of AnsibleError
...
Found with pylint
7 years ago
Alex Willmer
7245d574ef
Add missing auth_incorrect_msg used to in exception message
...
Found using pylint
7 years ago
Alex Willmer
6b9ac07e65
Declare self-less method as static
...
Found using pylint
7 years ago
Alex Willmer
bc4498e59e
Add missing imports: ast, compiler
...
Found using pylint
7 years ago
David Wilson
53ef6cda25
Treat EPIPE as disconnect too; needed for fakessh.
7 years ago
David Wilson
df1dc41d4f
Remove final vestiges of context.key.
7 years ago
David Wilson
f186b4c9d8
docs: Use sphinx-programoutput plugin for preamble_size.py
7 years ago
David Wilson
f62d4f1891
Update preamble_size output.
7 years ago
David Wilson
3e4cb308d5
core: Support profiling
7 years ago
David Wilson
b9cd5656a3
Delete mitogen.utils.log_to_tmp()
7 years ago
David Wilson
a836a7e555
fakessh: SSH server uses user's shell to parse command line.
7 years ago
David Wilson
f3ec8079be
fakessh: add to preamble_size.py
7 years ago
David Wilson
1ed8bb6924
Document a bunch of mitogen.master and move more docstrings into Sphinx.
7 years ago
David Wilson
c585f1bc5a
fakessh: Add integration test for inter-child rsync.
7 years ago
David Wilson
5fc59f72cb
master: propagate routes for IDs allocated via ALLOCATE_ID
...
needed for inter-child rsync.
7 years ago
David Wilson
5da8dc0cdc
Allow running without py.test.
7 years ago
David Wilson
959af50c1f
Make log_to_file accept string level rather than logging package constant
...
Saves an import, pain in the ass to type all the time.
7 years ago
David Wilson
3eda5ec671
core: remove pointless eval() of ARGV0 environment variable.
7 years ago
David Wilson
729356b5f0
master: make write_all() handle O_NONBLOCK and deadlines.
7 years ago
David Wilson
be2264f4c1
master: send_await() always unpickles now.
7 years ago
David Wilson
a6c97aad84
fakessh: improve logging slightly.
...
Makes it easier to match up reads/writes across log files by using
message byte count
7 years ago
David Wilson
68f3918072
core: set O_NONBLOCK on every side. Closes #33
...
The last time I tested set_nonblock() as a fix for the rsync hang, I
used F_SETFD rather than F_SETFL, which resulted in no error, but also
did not set O_NONBLOCK. Turns out missing O_NONBLOCK was the problem.
The rsync hang was due to every context blocking in os.write() waiting
for either a parent or child buffer to empty, which was exacerbated by
rsync's own pipelining, that allows writes from both sides to proceed
even while reads aren't progressing. The hang was due to os.write() on a
blocking fd blocking until buffer space is available to complete the
write. Partial writes are only supported when O_NONBLOCK is enabled.
7 years ago
David Wilson
16950a1620
core: Make iter_read() handle deadline (and non-blocking IO) properly
7 years ago
David Wilson
25adb7416a
Reorder table of contents.
7 years ago
David Wilson
1de875b4aa
Add serialization rules section.
7 years ago
David Wilson
aa5bc53f6d
Update test.
7 years ago
David Wilson
91d766ec81
core: Generalize/duplicate the call/send_await code using Receiver.
7 years ago
David Wilson
4ff1d4e523
master: use decorators rather than call_with_deadline(with_context=..)
7 years ago
David Wilson
d6d83b3fac
fakessh: cleanup master test.
7 years ago
David Wilson
5d0dcd051c
fakessh: use decorators rather than call_with_deadline(with_context=..)
7 years ago
David Wilson
456a40ce9c
core: synchronize Stream._output_buf by deferring send()
...
Previously _output_buf was racy. This may or may not be cheaper than
simply using a lock, but it requires much less code, so I prefer it for
now.
7 years ago
David Wilson
05055ebfc0
core: make Side.write() return None rather than crash if side already closed.
7 years ago
David Wilson
9ce71a546a
core: better Message.__repr__.
7 years ago
David Wilson
b7f5bd82bc
Replace `with_context` parameter with mitogen.core.takes_econtext decorator
7 years ago
David Wilson
22df965a46
fakessh: fix non-master context ID allocation.
7 years ago