[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:47:44 EST 2009


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

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

I am assuming there is a step in between 0 and 1a where the node is evicted.  

If it is not evicted, I do not see this problem and there are no deadlocks (using the following pseudocode to test:)

1.  put(fqn, k, v)
2.  start t1
3.  suspend t1
4.  start t2
5.  suspend t2
6.  resume t1
7.  getNode(fqn)
8.  suspend t1
9.  resume t2
10.  getNode(fqn)
11.  suspend t2
12.  resume and commit t1
13.  resume and commit t2

There is no deadlock and the test completes successfully, unless I have a step 1.5 which evicts fqn first.  Could you pls confirm this?






> 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