[systemd-devel] sd-bus: ObjectManager difference with gdbus
David Härdeman
david at hardeman.nu
Tue Apr 25 22:10:42 UTC 2017
On Tue, Apr 25, 2017 at 09:21:19PM +0200, David Härdeman wrote:
>On Tue, Apr 25, 2017 at 09:54:45AM +0200, David Herrmann wrote:
>>No, it does not. sd-bus was inconsistent. See, there are 3 things
>>involved in the Object-Manager:
>>
>>Signal: InterfacesAdded
>>Signal: InterfacesRemoved
>>Call: GetManagedObjects
>>
>>The first two signals are used to add and remove objects (and their
>>respective interfaces) at runtime. The GetManagedObjects() call is
>>used to bootstrap, that is, to get the initial set of objects (and
>>their respective interfaces) when starting your application.
>>
>>So far, sd-bus reported the builtin interfaces correctly via the
>>signals, but did not return that information in the
>>GetManagedObjects() call. My patch fixed this omission.
>>The effect of this is that objects added/removed at runtime work fine,
>>but if an object was there already when your application starts, then
>>it will never be removed, since gdbus will see an interface-count
>>mismatch (as you observed above).
>>
>>Hence, the patch I provided fixes how sd-bus provides this
>>information. It does *not* change any policy.
>>
>>I think the 2 underlying problems you saw are bugs in both gdbus and
>>sd-bus. The one in sd-bus I tried to fix above, the one in gdbus is
>>only about counting interfaces and properly detecting negative
>>interface-counts. The gdbus bug is non-severe, though, since it
>>originates in a buggy remote client. So there is no hard reason to
>>change gdbus there.
>
>Ok, I've tried the patch. It seems to fix things insofar that
>InterfacesAdded/InterfacesRemoved/GetManagedObjects all report 5
>interfaces (checked with dbus-monitor).
>
>gdbus still gets royally confused though. It seems to report 5
>interfaces for objects which are added dynamically (i.e. signalled via
>InterfacesAdded) and 1 interface for objects which are generated via
>GetManagedObjects (even though the sd-bus server reports 5 interfaces).
Scratch that. With your patch gdbus seems to consistently report 5
interfaces. But there's still some confusion to address in gdbus (the
additional interfaces have no names for example).
--
David Härdeman
More information about the systemd-devel
mailing list