[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5187) test020-proxycache failing in RE_2_4

On Dienstag, 6. November 2007, rhafer@suse.de wrote:
> I think I have an idea what causes this bug. It is possible that the client
> closes the connection before the server had a chance to run the cleanup
> handler, the server sets op->o_abandon then (in connection_closing()). And
> after that the cleanup handler is started, which in case of op->o_abandon
> does not store the results in the cache.
> To make this race more reproduceable it is sufficient to insert a
> usleep(100) before the call to slap_cleanup_play() in send_ldap_response()
> in result.c.
> Any suggestions for possible ways to fix this?

I think I found a way. 
1. The SLAPD_ABANDON/op->o_abandon part of the cleanup handler will now only 
get executed if the final result for the search has not  been received 
(caching_reason == PC_IGNORE).
2. Additionally, to add the entries to the cache, I do no longer use the 
original Connection Object but create a new one (connection_fake_init()), 
because the op->o_abandon will be set for the original connection as soon as 
the client closes it.

I'll do some more testing locally an submit this to HEAD later for more 
external testing.