Commit Graph

195 Commits (9aa845669ce2bfe700e22ce6babf7d64e03c82a5)

Author SHA1 Message Date
David Wilson 9aa845669c issue #413: don't double-propagate DEL_ROUTE to parent.
propagate_up() sends ADD_ROUTE and DEL_ROUTE

propagate_down() sends only DEL_ROUTE, but didn't bother checking if
up() had sent it already.

Fixes:

     ERROR! [pid 41060] 17:55:30.739159 E mitogen.ctx.ssh.localhost:
     mitogen: RouteMonitor(): received DEL_ROUTE for 6081 from
     mitogen.fork.Stream(u'fork.41142'), expected
     mitogen.core.Stream('parent')
5 years ago
David Wilson e2478dcb9f issue #498: wrap Router dict mutations in a lock 5 years ago
David Wilson ec789513dc ssh: tidy up logs and stream names. 5 years ago
David Wilson 4095358ea4 Merge commit '5bd6bd0' into envtest
* commit '5bd6bd0':
  parent: don't send messages on streams that no longer exist; closes #480
5 years ago
David Wilson d0075e7e50 parent: --with-pydebug bootstrap could fail due to corrupted stream
Due to first stage writin 'XXX refs' on exit. So close stderr as last
step of first stage.
5 years ago
David Wilson 2e4d7b15d7 parent: don't kill child when profiling=True 5 years ago
David Wilson 61297c24e5 issue #477: call_function_test fixes for 2.4. 5 years ago
David Wilson f1a712fad3 issue #477: Python<2.5 ioctl() request parameter was signed. 5 years ago
David Wilson 5bd6bd06d1 parent: don't send messages on streams that no longer exist; closes #480 5 years ago
David Wilson ffd46e9f1c issue #477: parent: make iter_read() log disconnect reason. 5 years ago
David Wilson 87d2af4c6e issue #477: polyfill partition() use in mitogen.parent. 6 years ago
David Wilson 07f1b9bdd0 issue #477: Python 2.5 needs next() polyfill too. 6 years ago
David Wilson 0ee8ee78b8 issue #477: Py2.4 cannot tolerate unicode kwargs. 6 years ago
David Wilson f3dae10fe1 issue #477: 2.4/2.5 had no better poller than poll(). 6 years ago
David Wilson 881dc7d5ca issue #477: more 2.4-compatible thread.get_ident() use. 6 years ago
David Wilson fb750edfa7 issue #61: fix bare except (reported by LGTM) 6 years ago
David Wilson 767737265a issue #61: add inverse comparison (reported by LGTM) 6 years ago
David Wilson 51bd35280a issue #61: remove duplicated method (reported by LGTM) 6 years ago
David Wilson ea9ef50b3c issue #415: replace default Poller with select.poll()
30% latency reduction for IPC.
6 years ago
David Wilson fd90834944 issue #408: fix test fallout. 6 years ago
David Wilson 51ac309647 issue #408: 2.4 compat: replace iter_read with explicit generator
Can't use yield inside try/finally on 2.4.
6 years ago
David Wilson 57b652eddc parent: remove unused imports
The stray functools import must have been there forever! Instant 4kb
knocked off wire footprint.
6 years ago
David Wilson de719fa249 core: throw error on duplicate add_handler(); closes #447. 6 years ago
David Wilson 85e965118d Merge remote-tracking branch 'origin/issue462'
* origin/issue462:
  issue #462: docs: update Changelog.
  parent: cope with broken /dev/pts on Linux; closes #462.
6 years ago
David Wilson 8fa3c74de4 issue #426: RouterMonitor format incorrect for 3->2 forward.
Each hop would cause "b''" to be wrapped around the context name.
6 years ago
David Wilson a4c7a98dd9 parent: cope with broken /dev/pts on Linux; closes #462. 6 years ago
David Wilson 2f3a8f2a32 parent: proxy_connect docstring. 6 years ago
David Wilson 3f5774cfd5 core: document/tidy up poller.
Remove duplicate attribute creates in subclasses too.
6 years ago
David Wilson 3876590aa1 parent: add descriptive errors for unsupported call() types.
Closes #439.
6 years ago
David Wilson 045db6f689 Fix iter_read() FD leaks on 3.x; closes #418. 6 years ago
David Wilson 76ec4f201c issue #413: paper over harmless duplicate del_route()
Ideally it would only be called once, and in future maybe it can, but
right now we need to cope with these cases:

* Downstream parent notifies us of disconnection (DEL_ROUTE)
* We notify ourself of disconnection
* We notify ourself and so does downstream parent

It's case 3 that causes the error.
6 years ago
David Wilson 802de6a8d5 issue #406: clean up DiagLogStream handling and connect() failure.
When Stream.connect() fails, have it just use on_disconnect(). Now there
is a single disconnect cleanup path.

Remove cutpasted DiagLogStream setup/destruction, and move it into the
base class (temporarily), and only manage the lifetime of its underlying
FD via Side.close().  This cures another EBADF failure.
6 years ago
David Wilson dc3db49c5a issue #406: more leaked FDs when create_child() fails. 6 years ago
David Wilson 17631b0573 issue #406: parent: close extra_fd on failure too. 6 years ago
David Wilson b3841317dd issue #406: clean up FDs on failure explicitly
The previous approach was crap since it left e.g. socketpair instances
lying around for GC with their underlying FD already closed, coupled
with FD number reuse, led to random madness when GC finally runs.
6 years ago
David Wilson 375182b71b issue #406: don't leak side FDs on bootstrap failure. 6 years ago
David Wilson 14b389cb46 issue #406: don't leak FDs on failed child start. 6 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.
6 years ago
David Wilson 1d32ed3b5a core: avoid shutdown() in IoLogger on WSL; closes #333. 6 years ago
David Wilson f2d288bb1e tests: ensure minify() result can be compiled for all of core. 6 years ago
David Wilson a7ee23719a issue #388: move a ton of documentation back into the source 6 years ago
David Wilson 0394dac2c7 docs: document RouteMonitor class. 6 years ago
David Wilson 71f9e84ab3 Add EOF error hints for LXC/LXD; closes #373. 6 years ago
David Wilson 22b4b186d7 issue #333: add versioning to EpollPoller too. 6 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.
6 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)
6 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.
6 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.
6 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.
6 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.
6 years ago