Please sign in to comment.
Exhaust all iterators to avoid memory leak
az482 In the select_fun for the intersection_op (i.e. AND) it would stop once one of it's iterators had been exhausted but would leave the other one as is, messages and all. So in the case where one side is empty and other side has a bunch of results (or this query is run a lot, memory usage = result size * # of queries) the results just sit on a process that waits indefinitely for something to pull the results off it's mailbox. The reason this doesn't occur if you use a PB conn for each transaction is because he PB conn is the parent of these processes and they are all linked. If it dies they all die. The solution is to make sure all iterators are exhausted.
- Loading branch information...
Showing with 13 additions and 8 deletions.