bus limits

David Zeuthen david at fubar.dk
Sun Aug 15 10:41:14 PDT 2004


On Sun, 2004-08-15 at 13:20 -0400, Havoc Pennington wrote:
> On Sun, 2004-08-15 at 12:48, David Zeuthen wrote:
> > Ok, the way I 'solved' this was to reconsider whether it's appropriate
> > at all to use D-BUS for the purpose of the point-to-point communication
> > that is sending messages from a hotplug helper spawned by the kernel to
> > a daemon. 
> > 
> > It pretty much isn't; it's private communication between two components
> > of the same software package (in this case hal), that's not entirely
> > what D-BUS is for
> 
> I do think this is a reasonable use of D-BUS, though I understand if
> you'd rather do something simple than try to answer the larger question
> about D-BUS limits behavior ;-)
> 

Heh :-) Well, maybe in point-to-point mode, but I was routing all my
messages through the bus, hence the limits issues. If messages can be
dropped it's a can of worms to do this way; here's what it looks like

      hal.hotplug              dbus-daemon-1              hald
          |           A             |                      |
          |------------------------>|           B          |
          |                         |--------------------->|
          |                         |                      |
          |                         |<---------------------|
          |<------------------------|           C          |
          |           D             |                      |

hal.hotplug invoked the method HotplugEvent service exposed by hald (I'm
not going to specify all the svc/if/obj's :-). Initially I just used
dbus_connection_send on a message with no_reply set and checked the
return value. Unfortunately this function doesn't return failure if a
limit have been reached. 

So I have to get a dummy reply from the service I'm invoking the call on
which first of all is a waste of bandwidth. However. We have four
messages in play here, A through D, anyone can get lost. I get a local
error if A fails (though that is not likely to happen), and 'The maximum
number of pending replies per connection has been reached' if B fails. 

What if C or D fails? Let's ignore D, that's not very likely (just like
A). C, on the other hand is just as likely to fail as B, the issue I
originally had. Well, hal.hotplug will get a timeout of some sort
waiting for a reply and then we have to try again. But this is bad since
hald would have to keep state to not process that method call again.

Cheers,
David





 





More information about the dbus mailing list