[rfc] move activation to a helper process

David Zeuthen david at fubar.dk
Mon Oct 16 21:15:00 PDT 2006


On Mon, 2006-10-16 at 10:21 -0400, David Zeuthen wrote:
>  - The test suite fails, says OOM handling doesn't work. I'm looking at
>    this, I think I'm doing the wrong thing if a BusTransactions fails,
>    should be feasible to fix (any quick ideas what I'm doing wrong?)
>    Apart from OOM handling the test suite works and this is good as the
>    test suite exercises a lot of the activation subsystem.

Here's an updated patch (this time even against HEAD, woohoo) that makes
'make check' pass. There's a few cleanups and changes in the activation
helper code. 

The main issue was that we didn't block on waiting for the child to be
killed (_dbus_babysitter_kill_child replacement)  when we wanted to
cancel an activation attempt. Since the IPC between bus and helper
process can never fail on OOM we can simply just wait for the event to
be delivered.

Anyway, make check now passes.

My plan for checking OOM handling right now includes extending the
custom IPC protocol (but only on DBUS_BUILD_TESTS) to ask the helper
about number of allocations (call it M) and instructing the helper to
make allocation m=0,1,...,M fail just like in _dbus_test_oom_handling.
Then the *_try_iterations functions in bus/dispatch.c will just go
through all N + M combinations where N is the number of allocations in
the bus process and M is the number of allocations in the helper
process. Does this sound somewhat sane?

There are also some trivial changes to dispatch.c to put new lines in
appropriate places.

Again, comments etc. on both the general approach and also details are
more than welcome (I realize it's a huge patch that takes long to
review).

     David

$ diffstat dbus-sysbus-activation-helper-2.patch 
 Makefile.am         |    5 
 activation-helper.c | 1635 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 activation-helper.h |   68 ++
 activation.c        |  351 ++++++-----
 bus.c               |   46 +
 bus.h               |   11 
 dispatch.c          |   50 -
 main.c              |    9 
 test-main.c         |   92 --
 test.c              |   76 ++
 test.h              |   17 
 11 files changed, 2110 insertions(+), 250 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-sysbus-activation-helper-2.patch
Type: text/x-patch
Size: 86351 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061017/14100014/dbus-sysbus-activation-helper-2-0001.bin


More information about the dbus mailing list