Tracking whether a connection is alive

Mike Hearn mike at
Sun Jul 11 15:46:12 PDT 2004

On Mon, 12 Jul 2004 00:20:38 +0200, David Zeuthen wrote:
> What if an application locks up? I've tried that with K3B actually. I
> guess what I'm asking for is that the system message bus pings all
> connections regularly, like, say every five seconds or so.

We definitely don't want that, it would slaughter performance by keeping
parts of all programs connected to the bus paged in (stack, code pages,

You can already send org.freedesktop.Peer.Ping if locking up is a problem
you wish to solve. Remember: In the case of an application has that GUI
locking up, the user will eventually try and close it when they realise
it's not responding at which point the WM will ping it and then force quit

What I'd suggest is that while a peer has a device locked HAL sends Ping
messages to that service every few seconds until it's unlocked. One
downside is that by requiring this I guess you make it harder to write
clients because if the task you're doing isn't easily interruptable (is CD
writing? I guess it must be ....) you need threading and such to respond
to pings.

Still it is probably the best course of action. Ping while a lock is held,
don't ping while it's not.

For the Galago case, if a client hangs the user has to kill it themselves
anyway at which point the connection will close and presence info can be
updated. Pinging should only be used when absolutely critical in order to
keep the systems working set low. I suspect it's for that reason that
Metacity only pings clients when a close request is ignored.

thanks -mike

More information about the dbus mailing list