Dbus Messages Guaranteed?
hp at redhat.com
Fri Jun 29 10:59:19 PDT 2007
Patrick Davis wrote:
> Simple question. Does DBus guarantee delivery of messages, specifically
> methods, assuming the functions are called properly, and that there is
> sufficient memory in the server for the daemon to receive the message?
If you ask for a reply (don't set the no reply flag) generally you can
assume either the message will go through or you will get a reply (the
reply may be an error, though).
> If not, what else besides improper calls and insufficient memory can
> cause messages to not be delivered?
Disconnection/crash by either the sender or recipient is another
possibility. Also if there's a security policy that blocks a message it
will get an error instead of going through.
If both sender and recipient remain connected, there is no reason to
expect delivery to fail.
If using TCP instead of local unix sockets, of course all the usual
network errors can happen (timeouts, DNS failures, etc.)
Generally dbus is a reliable transport in the same way that TCP or UNIX
domain sockets are, and has the same kind of failure modes. Not
surprising since dbus is just a way to send messages over sockets.
If you want to know a message was definitely received you should check
for the successful reply to the method call - that's the only proof that
the other end processed the message.
Without a reply, even if the message was fully written out to the
recipient by the bus daemon, you don't know that the recipient read it
off the socket (the recipient may have exited without ever reading, for
If the bus daemon writes out a message to a recipient and the recipient
disconnects before replying, the bus daemon generates a timeout error
reply for the still-pending call.
More information about the dbus