Loop-detection in assoc_find..

Trond Norbye Trond.Norbye at Sun.COM
Thu Apr 24 20:09:19 UTC 2008

On Apr 24, 2008, at 12:07 PM, Miguel DeAvila wrote:

> On Friday 18 April 2008 13:25:38 Trond Norbye wrote:
>> We have had some discussions lately about a loop in assoc_find, and
>> since we currently haven't been able to reproduce this problem in our
>> test environment I think that we should add loop detection into the
>> assoc_find routine.
>> The following is a patch (for the binary branch) that implements  
>> this.
> I don't think the patch is sufficient. The loop that I encountered  
> involved three
> items (A -> B -> C -> A) ... the patch only detects loops between  
> adjacent items.

Hmm.. Are you sure? The logic I used was that I send the "lookahead"  
pointer two steps down the road each time I move the current pointer.  
It should then detect any loops eventually... even a loop at the end  
of a chain like: a->b->c->d->e->f->c


More information about the memcached mailing list