FW: [Mondrian] deadlock in MemberCacheHelper
Rushan Chen
rchen at lucidera.com
Thu May 1 13:23:38 EDT 2008
We just confirmed that Will's change in 10922 fix the deadlock issue in
one of our multi-threaded tests.
Thanks, Will!
Rushan
Will Gorman wrote:
> Hi Julian,
>
> I've investigated this a bit. The issue is related to the two caches
> RolapCubeHierarchy.RolapCubeHierarchyMemberReader manages. The
> inherited cacheHelper (A) from SmartMemberReader is used to store cube
> specific RolapMembers, and the rolapCubeCacheHelper (B) which stores
> cube specific RolapCubeMember wrappers. In the first stack trace,
> SqlTupleReader.readTuple locks cache B, and then locks cache A. In the
> second stack trace, RolapSchemaReader locks cache A, and then locks
> cache B.
>
> Now that I know what is going on, I'll need to write a unit test that
> simulates this deadlock... it shouldn't be too difficult. In the mean
> time, setting the enableCache option to false that you added should
> remove the deadlock.
>
> Will
>
> On Thu, 2008-04-03 at 10:53 -0700, Julian Hyde wrote:
>
>> Will,
>>
>> The deadlock is a cyclic wait between two MemberCacheHelper objects.
>> One thread holds A and waits for B, another holds B and waits for A.
>>
>> Usually deadlocks can be solved by agreeing a locking order by object
>> type (e.g. first lock the RolapSchema then lock the MemberCacheHelper)
>> but that won't work in this case, because both locked objects are the
>> same type.
>>
>> We need to figure out what operation would ever need to lock two
>> different MCHs. Thoughts on this?
>>
>> Julian
>>
>> PS Nicely formatted stack trace is attached.
>>
>>
>> ______________________________________________________________________
>> From: mondrian-bounces at pentaho.org
>> [mailto:mondrian-bounces at pentaho.org] On Behalf Of Julian Hyde
>> Sent: Wednesday, April 02, 2008 9:45 PM
>> To: 'Mondrian developer mailing list'
>> Subject: RE: [Mondrian] deadlock in MemberCacheHelper
>>
>>
>>
>> Logged bug 1932920 Deadlock in MemberCacheHelper. Will take a look
>> tomorrow.
>>
>>
>>> -----Original Message-----
>>> From: mondrian-bounces at pentaho.org
>>> [mailto:mondrian-bounces at pentaho.org] On Behalf Of John V. Sichi
>>> Sent: Wednesday, April 02, 2008 5:31 PM
>>> To: mondrian at pentaho.org
>>> Subject: [Mondrian] deadlock in MemberCacheHelper
>>>
>>> A concurrency scenario for LucidEra perf tests (run as part of
>>> validating the mainline Mondrian codebase for integration)
>>> ran into the
>>> deadlock below. The code being tested was fairly recent (I
>>> can dig up
>>> the change number if any line numbers don't match).
>>>
>>>
>> <snip>
>>
>>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
--
Rushan Chen
rchen at lucidera.com
Read <http://tinyurl.com/ypc73a> our customer reviews: "LucidEra is a
must have tool for any company that extensively uses salesforce.com"
Test drive <http://www.lucidera.com/test-drive.php> LucidEra Revenue
Cycle Analysis
Comment <http://www.lucidera.com/blog/> on our "Keep it Simple" blog
More information about the Mondrian
mailing list