Commit Graph

5 Commits (ea9ef50b3c0056694db56a5fa2f4af73c4b3592e)

Author SHA1 Message Date
David Wilson a561fb79e5 docs: merge more docs back into mitogen/core.py. 6 years ago
David Wilson 43e9e51ed6 docs: link signals into internals.rst. 7 years ago
David Wilson 38c0ad1eea core: don't deregister Router handles until Broker exit.
Lots of "invalid handle: ..., 102" messages started appearing during
exit recently because ordering changed slightly, and local handles were
sent _DEAD even though the broker loop was still progressing through
shutdown.

The "shutdown" event is too early to close handles: it is the start of
the grace period where streams and downstream contexts can finish up any
work and deliver buffered data, including FORWARD_LOG messages that
haven't arrived yet.

So instead,

- move the _DEAD logic to the "exit" event,
- get rid of Context.on_shutdown() entirely, it's been unused for over
  a month,
- get rid of the "crash" event, since it always fires prior to "exit",
  and its only use was to send _DEAD to local handles, which now happens
  during exit anyway.
7 years ago
David Wilson 27175e3126 docs: tidy up signals.rst a little. 7 years ago
David Wilson 2ecc6f43a4 docs: Import, but do not yet link signals.rst 7 years ago