Many Thanks Ryan,

You the man!!

--g


On Jun 24, 2011, at 10:58 , Ryan Zezeski wrote:

Gordon, Gilbert, and all you Search fans out there,

I've patched this bug in the riak_search-0.14 branch.  Below you'll find a link 
to the pull request.

The bug was a little tricky to find but is fairly "obvious" once you see what 
is happening.  The leak occurs when you perform an intersection query (i.e. 
`AND`) where one side is an empty result and the other side has results (which 
side is empty does not matter).  Essentially, the query executor in Search will 
"short-circuit" the execution on either side and stop once one side has been 
exhausted but leave the results for the other side just hanging around.  That 
is, the process that collected the results will wait indefinitely for another 
process to pull them off.  Gordon, this is why your gist 
(https://gist.github.com/1010384) alleviated the leak.  However, it's not an 
appropriate fix because you could lose data in more extreme conditions.  My fix 
was to make sure both sides of an `AND` are exhausted after an answer has been 
found.

TL;DR - Using an `AND` clause in your query where one side is empty (or small) 
and the other side has results (or is larger than the other side) will cause 
processes and it's corresponding msgs to sit around, waiting indefinitely.

https://github.com/basho/riak_search/pull/66

-Ryan

P.S. Gordon & Gilbert, thank you for taking the time to share your findings 
with us and especially Gordon for taking the time to make a reproducible test 
case which was key in helping me quickly solve this.

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to