exit-on-idle (yes again)
Colin Walters
walters at verbum.org
Wed Oct 4 13:25:46 UTC 2017
Following up to
https://lists.freedesktop.org/archives/dbus/2015-May/016671.html
https://lists.freedesktop.org/archives/dbus/2017-September/017296.html
etc.
I recently landed a change in rpm-ostree that I'm pretty happy with:
https://github.com/projectatomic/rpm-ostree/pull/606
Basically this is the "agent pattern" - but one trick here is to send
the "register" method call to the *well known* name, and use a retry
loop in case we get NoReply.
After that we can create a proxy using the unique name like
GDBus prefers (and this makes sense to me).
This discussion crosses a lot of other ones, like the active thread
https://lists.freedesktop.org/archives/dbus/2017-October/017312.html
While I haven't looked in detail at the dbus broker approach, I'm
still skeptical of the approach without something like this.
Obviously a major tradeoff with this approach is that if e.g.
a client app leaks a proxy, the *entire daemon* then "leaks".
Anyways I'm not 100% confident this approach is truly race-free,
but it's survived a lot of my testing, and in the end we're not
relying on any magic tricks on the dbus-daemon/kernel/whatever
side, and we're not scoping in trying to handle the daemon
exiting while a process may still be talking to it.
One next step we could take here would be to standardize
the "agent registration" interface, and teach higher level
libraries like GDBus etc. how to use it.
More information about the dbus
mailing list