[jbosscache-issues] [JBoss JIRA] Commented: (JBCACHE-1479) Loads nodes from cache loader too aggresively

Manik Surtani (JIRA) jira-events at lists.jboss.org
Mon Feb 16 06:49:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JBCACHE-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12452764#action_12452764 ] 

Manik Surtani commented on JBCACHE-1479:
----------------------------------------

And regarding the deadlock when the node is evicted and concurrently loaded, this is needed since loading writes to the internal data structure and this should be guarded with a WL to prevent concurrent threads overwriting this state (or worse, loaded, 'old' state overwriting newer state being written by a concurrent thread).  Some advice would be to use relatively short lived transactions and make sure your tx timeout is less than your lock acquisition timeout.

> Loads nodes from cache loader too aggresively
> ---------------------------------------------
>
>                 Key: JBCACHE-1479
>                 URL: https://jira.jboss.org/jira/browse/JBCACHE-1479
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Cache loaders, Transactions
>    Affects Versions: 3.0.2.GA, 3.1.0.GA
>            Reporter: Krzysztof Sobolewski
>            Assignee: Manik Surtani
>
> I have a test that goes like this (all in the same thread):
> 0. populate cache with a single node, via a simple put().
> 1a. start transaction 1 (and suspend)
> 1b. start transaction 2 (and suspend)
> 2a. resume tx1
> 2b. get the node
> 2c. suspend tx1
> 3a. resume tx2
> 3b. get the node
> 3c. suspend tx2
> 4. resume and end both transactions
> With 2.2 it works fine. With 3.x (3.0.2 and trunk) it timeouts on step 3b. The problem is that even though the node was added by me and was not evicted, the CacheLoaderInterceptor tries to load it for both transactions (steps 2b and 3b). This entails a write lock, hence a deadlock. From what I gather this is because the "data loaded" flag is never set on the node and it confuses the interceptor, which tries to load (and puts a write lock) on each and every access. My guess is that the flag should be set to true after put() -- if I do it "by hand", there is no deadlock (but then some other test fails, which means that I'm not qualified to fix this problem :) )

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosscache-issues mailing list