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

Stephen Gallagher sgallagh at redhat.com
Wed Jun 24 12:45:51 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/24/2009 08:43 AM, Simo Sorce wrote:
> 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, what I was saying is that if the connection has disconnected, then
the service has already exited. (I.E. the backend has already died and
needs to re-init anyway)

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkpCH+gACgkQeiVVYja6o6OePACfWGqUouWf9C9VmXJbMF5/39ov
VoEAnAoNbvOvLywTNZfxpXdw+PJFwz6H
=UtTG
-----END PGP SIGNATURE-----




More information about the Freeipa-devel mailing list