[PATCH 3/3] activation: optionally, use systemd for system bus activation
mzqohf at 0pointer.de
Fri Jul 9 07:40:06 PDT 2010
On Fri, 09.07.10 10:22, Colin Walters (walters at verbum.org) wrote:
> On Wed, Jun 23, 2010 at 12:12 PM, Lennart Poettering <mzqohf at 0pointer.de> wrote:
> > + /* systemd is not around, let's "activate" it. */
> > + retval = bus_activation_activate_service (activation, connection, activation_transaction, TRUE,
> > + message, "org.freedesktop.systemd1", error);
> If we recurse here, we'll be creating *two* entries in the
> activation->entries list, both with the same message, right? One for
> the initial request, and one to activate systemd itself. Then when
> systemd comes online, the bus will send two replies back, right?
It's not for the same message. It's like this:
a) App A sends message X to app B
b) B is not around → D-Bus sends activation message Y to systemd, and queues X
c) systemd is not around yet → D-Bus waits for systemd and queues Y
[ at this point both X and Y are queued ]
d) systemd arrives on the bus, Y is delivered to it
e) systemd sees Y, activates B
f) B arrives on the bus, X is delivered to it.
i.e. the two queued messages are different: there's X which is the
original message to be delivered, and there's Y which is the actviation
> Honestly the recursion here, especially trying to think about the OOM
> failure cases is making my head hurt =)
Well, if OOM eats X or Y then the activation request will eventually
time out. Which is OK behaviour I think.
Lennart Poettering - Red Hat, Inc.
More information about the dbus