Commit Graph

2806 Commits (2ee0e070374982dc13b0bd3a759ec35a102e629d)
 

Author SHA1 Message Date
David Wilson 2ee0e07037 core: MitogenProtocol.is_privileged was not set in children
Follow the previous unidirectional routing fix, now errors are occurring
where they should not.
5 years ago
David Wilson 83a86a2ce1 issue #482: tests: fail DockerMixin tests if stray processes exist 5 years ago
David Wilson e352b9e5fd docs: update Changelog. 5 years ago
David Wilson 6fa69955c4 issue #586: update Changelog. 5 years ago
David Wilson f0138072f1 docs: update Changelog. 5 years ago
David Wilson 5924af1566 [security] core: undirectional routing wasn't respected in some cases
When creating a context using Router.method(via=somechild),
unidirectional mode was set on the new child correctly, however if the
child were to call Router.method(), due to a typing mistake the new
child would start without it.

This doesn't impact the Ansible extension, as only forked tasks are
started directly by children, and they are not responsible for routing
messages.

Add test so it can't happen again.
5 years ago
David Wilson 436a4b3b3c docs: tidy up Select.all() 5 years ago
David Wilson 5ae6f92177 issue #612: update Changelog. 5 years ago
dw c6de090f08
Merge pull request #612 from marc1006/master
Some smaller fixes
5 years ago
Marc Hartmayer 2ed8395d6c master: fix TypeError
Add a guard for the case `path == None`.

This commit fixes

`TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType`
5 years ago
Marc Hartmayer 0a6c0cd8fb pkgutil: fix Python3 compatibility
Starting with Python3 the `as` clause must be used to associate a name to the
exception being passed.
5 years ago
Marc Hartmayer 444b7d6d97 parent: use protocol for getting remote_id
Fixes 8d1b01d8ef ("Refactor Stream, introduce quasi-asynchronous connect, much
more").
5 years ago
David Wilson 8eeff66bd7 Merge remote-tracking branch 'origin/dmw'
* origin/dmw:
  docs: merge signals.rst into internals.rst
  os_fork: do not attempt to cork the active thread.
  parent: fix get_log_level() for split out loggers.
  issue #547: fix service_test failures.
  issue #547: update Changelog.
  issue #547: core/service: race/deadlock-free service pool init
  docs: update Changelog.
  select: make Select.add() handle multiple buffered items.
  core/select: add {Select,Latch,Receiver}.size(), deprecate empty()
  parent: docstring fixes
  core: remove dead Router.on_shutdown() and Router "shutdown" signal
  testlib: use lsof +E for much clearer leaked FD output
  [stream-refactor] stop leaking FD 100 for the life of the child
  core: split preserve_tty_fp() out into a function
  parent: zombie reaping v3
  issue #410: fix test failure due to obsolete parentfp/childfp
  issue #170: replace Timer.cancelled with Timer.active
  core: more descriptive graceful shutdown timeout error
  docs: update changelog
  core: fix Python2.4 crash due to missing Logger.getChild().
  issue #410: automatically work around SELinux braindamage.
  core: cache stream reference in DelimitedProtocol
  parent: docstring formatting
  docs: remove fakessh from home page, it's been broken forever
  docs: add changelog thanks
  Disable Azure pipelines build for docs-master too.
  docs: udpate Changelog.
  docs: tweak Changelog wording
  [linear2] merge fallout: re-enable _send_module_forwards().
  docs: another round of docstring cleanups.
  master: allow filtering forwarded logs using logging package functions.
  docs: many more internals.rst tidyups
  tests: fix error in affinity_test
  service: centralize fetching thread name, and tidy up logs
  [stream-refactor] get caught up on internals.rst updates
  Stop using mitogen root logger in more modules, remove unused loggers
  tests: stop dumping Docker help output in the log.
  parent: move subprocess creation to mux thread too
  Split out and make readable more log messages across both packages
  ansible: log affinity assignments
  ci: log failed command line, and try enabling stdout line buffering
  ansible: improve docstring
  [linear2] simplify _listener_for_name()
  ansible: stop relying on SIGTERM to shut down service pool
  tests: move tty_create_child tests together
  ansible: cleanup various docstrings
  parent: define Connection behaviour during Broker.shutdown()
  issue #549: ansible: reduce risk by capping RLIM_INFINITY
5 years ago
David Wilson 5970b041e0 docs: merge signals.rst into internals.rst 5 years ago
David Wilson e3dcce2069 os_fork: do not attempt to cork the active thread. 5 years ago
David Wilson 3231c62a66 parent: fix get_log_level() for split out loggers. 5 years ago
David Wilson cc02906d2a issue #547: fix service_test failures. 5 years ago
David Wilson 41d180495a issue #547: update Changelog. 5 years ago
David Wilson 769a8b2015 issue #547: core/service: race/deadlock-free service pool init
The previous method of spinning up a transient thread to import the
service pool in a child context could deadlock with use of the importer
on the main thread. Therefore wake the main thread to handle import for
us, and use a regular Receiver to buffer messages to the stub, which is
inherited rather than replaced by the real service pool.
5 years ago
David Wilson 50b2d590fd docs: update Changelog. 5 years ago
David Wilson ecc570cbda select: make Select.add() handle multiple buffered items.
Previously given something like:

    l = mitogen.core.Latch()
    l.put(1)
    l.put(2)

    s = mitogen.select.Select([l], oneshot=False)
    assert 1 == s.get(block=False)
    assert 2 == s.get(block=False)

The second call would throw TimeoutError, because Select.add() only
queued the receiver/latch once if it was non-empty, rather than once for
each item as should happen.
5 years ago
David Wilson 49a6446af8 core/select: add {Select,Latch,Receiver}.size(), deprecate empty()
Knowing an estimate of the buffered items is needed for adding a
latch/receiver with many existing buffered items via Select.add().
5 years ago
David Wilson 95b067a114 parent: docstring fixes 5 years ago
David Wilson b33b29af33 core: remove dead Router.on_shutdown() and Router "shutdown" signal
Its functionality was duplicated by _on_broker_exit() somewhere along
the way, and nothing has referred to it in a long time. I have no idea
how this happened.

Merge its docstring into _on_broker_exit() and delete it, remove the
Router "shutdown" signal after confirming it has no users, and move all
the Router-originated error messages together in a block at the top of
the class.

Already covered by router_test.AddHandlerTest.test_dead_message_sent_at_shutdown
5 years ago
David Wilson c0d87c0aa1 testlib: use lsof +E for much clearer leaked FD output 5 years ago
David Wilson 70deb34bce [stream-refactor] stop leaking FD 100 for the life of the child
This prevents successful detachment since [stream-refactor] landed
5 years ago
David Wilson f304ab8dec core: split preserve_tty_fp() out into a function 5 years ago
David Wilson f4cee16526 parent: zombie reaping v3
Improvements:

- Refactored off Process, separately testable without a connection
- Don't delay Broker shutdown indefinitely for detached children
5 years ago
David Wilson 709a0c013f issue #410: fix test failure due to obsolete parentfp/childfp 5 years ago
David Wilson 9c0cb44ee9 issue #170: replace Timer.cancelled with Timer.active
It's more flexable: False can represent 'cancelled' or 'expired',
whereas setting cancelled=True for an expired timer didn't feel right.
5 years ago
David Wilson 9839e6781c core: more descriptive graceful shutdown timeout error
Accounts for timers too
Tidy up a wordy comment further down the file
5 years ago
David Wilson dd1fed0a5f docs: update changelog 5 years ago
David Wilson 65bec2244d core: fix Python2.4 crash due to missing Logger.getChild(). 5 years ago
David Wilson e8b1bf5909 issue #410: automatically work around SELinux braindamage. 5 years ago
David Wilson ce04fd39c9 core: cache stream reference in DelimitedProtocol
Stream.set_protocol() was updated to break the reference on the previous
protocol, to encourage a crash should an old protocol continue operating
after it's not supposed to be active any more.

That broke DelimitedProtocol's protocol switching functionality.
5 years ago
David Wilson ad590f3321 parent: docstring formatting 5 years ago
David Wilson 87443da828 docs: remove fakessh from home page, it's been broken forever 5 years ago
David Wilson 0d636af532 docs: add changelog thanks 5 years ago
David Wilson 351aca62c9 Disable Azure pipelines build for docs-master too. 5 years ago
David Wilson be330194d5 docs: udpate Changelog. 5 years ago
David Wilson b7cdd39044 docs: tweak Changelog wording 5 years ago
David Wilson 6f12980611 [linear2] merge fallout: re-enable _send_module_forwards(). 5 years ago
David Wilson a79d2bd50b docs: another round of docstring cleanups. 5 years ago
David Wilson 20532ea591 master: allow filtering forwarded logs using logging package functions.
Given a message sent on "ssh.foo" to "mypkg.mymod", instead of logging
it to "mitogen.ctx.ssh.foo" in the master process, with the message
prefixed with the original logger name, instead log it to
"mypkg.mymod.[ssh.foo]", permitting normal logging package filtering
features to work as they usually do.

This also helps tidy up logging output a little bit.
5 years ago
David Wilson feb1654305 docs: many more internals.rst tidyups 5 years ago
David Wilson 22a07a043b tests: fix error in affinity_test 5 years ago
David Wilson 11c7e3f561 service: centralize fetching thread name, and tidy up logs 5 years ago
David Wilson f0782ccd42 [stream-refactor] get caught up on internals.rst updates 5 years ago
David Wilson 7379144a12 Stop using mitogen root logger in more modules, remove unused loggers 5 years ago
David Wilson 212f6a3529 tests: stop dumping Docker help output in the log. 5 years ago