[Mulgara-dev] Lost phase token

Alex Hall alexhall at revelytix.com
Thu Sep 24 20:38:04 UTC 2009


James Leigh wrote:
> On Thu, 2009-09-24 at 16:22 -0400, Paul Gearon wrote:
>> On Thu, Sep 24, 2009 at 4:10 PM, Life is hard, and then you die
>> <ronald at innovation.ch> wrote:
>>
>> <snip/>
>>
>>> Ah, this is delete-select. Ok, I think I see it:
>>> DatabaseOperationContext, around line 715 we have
>>>
>>>          Tuples oldTuples = tuples;
>>>          tuples = TuplesOperations.append(tuples, resolution);
>>>          oldTuples.close();
>>>
>>> But 'resolution' is never closed...
>> Ah, you got there first. I still had some stack to go. I was just
>> finishing up checking ModifyGraphOperation when your email arrived.
>> :-)
>>
>> You're right on this (of course). One exit path just returns the
>> resolution (meaning that it can't be closed), but when more than one
>> graph is being queried then it keeps appending these resolutions (as
>> shown above), and returns the accumulated result. The "append"
>> operation takes a clone of the resolution, leaving us free to clean it
>> up, but of course, that wasn't happening.
>>
>> We probably need more test cases that look at multiple graphs coming
>> from multiple resolvers, as that is what is triggering this code path.
>>
>> Paul
> 
> Thanks Ronald, Paul, and Alex for the all help and kudos to Ronald for
> find this bug. Since this lost phase token is now nearly resolved, can
> the phase stack trace be changed to only be created if in debug mode
> (not info)? This will then solve my out-of-memory exception error from
> earlier.

I think that's a good idea. While we're at it, it would probably be good
to move the stack trace capture to the use() method since that turned
out to be much more helpful in debugging the root cause of the problem.

-Alex



More information about the Mulgara-dev mailing list