max_outgoing_bytes: What if a D-Bus peer is too slow to read?

Alban Crequy alban.crequy at collabora.co.uk
Thu Oct 7 11:25:27 PDT 2010


Le Thu, 7 Oct 2010 13:49:09 -0400,
Colin Walters <walters at verbum.org> a écrit :

> The implications for a kernel implementation are more complicated; one
> approach that comes to mind is that a client app can write its message
> to the socket; if the kernel can't deliver it to some of them, it
> writes back a special message "I failed to deliver to the following
> recipients, please try again".  After that userspace could poll, which
> would be lame, but then again we don't really expect this to happen
> often.  Possibly there could be another special message which notifies
> of non-full buffers for particular connections.

Message deliveries should be atomic: either delivered to all recipients
or none of them. Otherwise it would break the causal order:
- A delivers the message M1 to B and C
- C's queue is full, so M1 is delivered only to B
- B receives M1 and sends M2 to C
- C empties its queue and receives M2 from B
- A tries again to deliver the first M1 to C
- C received M1 and M2 in the wrong causal order

Also, if A terminates meanwhile, M1 would be delivered only to a subset
of recipients. Just closing C's connection is easier.



More information about the dbus mailing list