Using D-BUS to notify apps of a pending snapshot?

Havoc Pennington hp at redhat.com
Thu Aug 5 01:23:53 PDT 2004


On Wed, 2004-08-04 at 04:48, Craig Ringer wrote:
> I've been toying with the idea of using D-BUS
> (http://freedesktop.org/Software/dbus ) to notify applications enhanced
> to be D-BUS aware of a pending snapshot, and thought I'd ask here for
> feedback.

This is the kind of thing we envision D-BUS being used for. I don't know
enough about LVM to comment on whether you really want to do it, but
certainly if you do D-BUS is a sensible implementation component.

> Questions that remain:
> 	- A good way of determining aware apps. The approach above suffers from
> timing issues, as LVM must decide to wait only x seconds before assuming
> no other apps will make themselves known. D-BUS provides a way to
> discover other listening processes, so perhaps this would be a better
> approach.
> 	- How to handle the situation of an aware app not responding? Time out
> and take the snapshot anyway?

The situation here is pretty much exactly the same as session management
for desktop apps. The way that works is that apps register with the
session manager, so the SM knows which ones are out there. The advantage
of that is that you can know when all existing apps have replied, and
thus in the non-broken case things run really quickly; the timeout can
be relatively long since it will only expire if particular apps don't
respond. Plus the session manager knows which app did not respond and
can place blame accordingly in the error message. ;-)

Havoc




More information about the dbus mailing list