[Freeipa-devel] [PATCH 0020] Separate LDAP result from LDAP connection, fix deadlock.

Petr Spacek pspacek at redhat.com
Mon May 14 14:44:42 UTC 2012


On 05/11/2012 12:26 PM, Adam Tkac wrote:
> On Mon, May 07, 2012 at 02:49:07PM +0200, Petr Spacek wrote:
>> Hello,
>>
>> this patch fixes https://fedorahosted.org/bind-dyndb-ldap/ticket/66:
>> Plugin deadlocks during new zone load when connections == 1.
>>
>> It fixes structural problem, when LDAP query result was tied with
>> LDAP connection up. It wasn't possible to release connection and
>> work with query result after that.
>> Described deadlock is consequence of this problematic design.
>>
>> Now LDAP connection is separated from LDAP result. Next planed patch
>> will avoid "manual" connection management, so possibility of
>> deadlock should be next to zero.
>>
>> Petr^2 Spacek
>
> Hello Peter,
>
> good work, please check my comments below.
>
> Regards, Adam
>
>>  From 8ee1fd607531ef71369e99c9228456baea45b65d Mon Sep 17 00:00:00 2001
>> From: Petr Spacek<pspacek at redhat.com>
>> Date: Mon, 7 May 2012 12:51:09 +0200
>> Subject: [PATCH] Separate LDAP result from LDAP connection, fix deadlock.
>>   https://fedorahosted.org/bind-dyndb-ldap/ticket/66
>>   Signed-off-by: Petr Spacek<pspacek at redhat.com>

Hello Adam,

thanks for ideas/improvements!

Reworked patch is attached. I did all proposed changes except this one:

@ ldap_psearch_watcher:
>>   restart:
(... snip ...)
>>   soft_err:
>> -
>> -			ldap_msgfree(conn->result);
>> -			ldap_entrylist_destroy(conn->mctx,
>> -					&conn->ldap_entries);
>> +			;
>
> Empty label "soft_err:" is useless, please remove it and use "continue;" on
> appropriate places;

I think "continue" in this place can lead to memory leak, so I removed 
soft_err by other way.

Petr^2 Spacek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind-dyndb-ldap-pspacek-0020-2-Separate-LDAP-result-from-LDAP-connection-fix-deadlo.patch
Type: text/x-patch
Size: 19841 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120514/374704c6/attachment.bin>


More information about the Freeipa-devel mailing list