[Freeipa-devel] [PATCH] check pending_return after dbus_connection_send_with_reply

Simo Sorce ssorce at redhat.com
Wed Jun 24 12:43:32 UTC 2009


On Wed, 2009-06-24 at 06:06 -0400, Stephen Gallagher wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 06/24/2009 03:37 AM, Sumit Bose wrote:
> > Am 23.06.2009 23:18, schrieb Simo Sorce:
> >> On Tue, 2009-06-23 at 15:05 +0200, Sumit Bose wrote:
> >>> Hi,
> >>>
> >>> according to
> >>> http://dbus.freedesktop.org/doc/dbus/api/html/group__DBusConnection.html#ga951b2a6f6c4069fa392752000b24ebe
> >>> dbus_connection_send_with_reply can return TRUE, but set pending_return
> >>> to NULL. This patch adds a check to protect the following call which try
> >>> to use pending_return.
> >>>
> >>> I have found this while running some load tests with >40 parallel
> >>> authentication requests.
> >> Your patch will cacth it but the effect is the same (we will ourselves).
> >> Do you know in what cases this can happen and what it means ?
> > 
> > According to the url above pending_return == NULL means that the
> > connection is disconnected.
> > 
> >> Why does it return true if pending_return is null ?
> >>
> Simo, the function only returns false if there was a memory allocation
> error.
> > 
> > dbus at lists.freedesktop.org ?
> > 
> >> Is there anything we can do, like loop back and retry 2-3 times before
> >> giving up ?
> >>
> > 
> > I do not know if it makes sense here. If the connection is disconnected
> > the reason might be that the other side of the connection died. If the
> > other side is restarted by the monitor can we use the old connection or
> > it is necessary to reconnect?
> > 
> 
> I agree with Sumit. The only reason a peer-to-peer D-BUS connection
> would be disconnected is if one end of it exited. So retrying is just
> wasting cycles. It's better to just kill it off and let the monitor
> restart the offending process.

I'd rather reconnect if possible.
Killing off a backend would entail reconnecting to remote servers or
perform other initialization, etc.. It would be nice if we could avoid
that when possible, and leave deadly measures to when we can't do
anything else.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list