[jboss-jira] [JBoss JIRA] Resolved: (JBCACHE-97) ReadWriteLockWithUpgrade: UpgradeException with more than 1 reader/writer waiting to upgrade lock

Jason T. Greene (JIRA) jira-events at lists.jboss.org
Tue Jun 26 18:55:58 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBCACHE-97?page=all ]

Jason T. Greene resolved JBCACHE-97.
------------------------------------

    Fix Version/s: 2.0.0.GA
                       (was: 2.1.0.GA)
       Resolution: Won't Fix

After investigating this, it is not possible to fix this without breaking repeatable read semantics. So if you don't want to handle this exception set the isolation level to READ_COMMITTED, or use optimistic locking.

> ReadWriteLockWithUpgrade: UpgradeException with more than 1 reader/writer waiting to upgrade lock
> -------------------------------------------------------------------------------------------------
>
>                 Key: JBCACHE-97
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-97
>             Project: JBoss Cache
>          Issue Type: Bug
>          Components: Clustering
>            Reporter: Bela Ban
>         Assigned To: Jason T. Greene
>             Fix For: 2.0.0.GA
>
>
> TxDeadlockUnitTestCase has 2 methods that show the following stack traces:
> testMoreThanOneUpgrader:
> Upgrader#0: get(/a/b/c)
> Upgrader#1: get(/a/b/c)
> main: locks: 
> /a	(read owners=[<null>:2, <null>:1])
>     /b	(read owners=[<null>:2, <null>:1])
>         /c	(read owners=[<null>:2, <null>:1])
> Upgrader#0: put(/a/b/c)
> Upgrader#1: put(/a/b/c)
> Upgrader#1: org.jboss.cache.lock.LockingException: acquireWriteLock(): lock upgrade failed for /a/b/c (caller=<null>:2); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock)
> Upgrader#0: org.jboss.cache.lock.TimeoutException: upgrade lock for /a/b/c could not be acquired after 3000 ms. Lock map ownership Read lock owners: [<null>:2]
> Write lock owner: null
>  (caller=<null>:1)
> org.jboss.cache.lock.TimeoutException: upgrade lock for /a/b/c could not be acquired after 3000 ms. Lock map ownership Read lock owners: [<null>:2]
> Write lock owner: null
>  (caller=<null>:1)
> 	at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:155)
> 	at org.jboss.cache.Node.acquireWriteLock(Node.java:448)
> 	at org.jboss.cache.Node.acquire(Node.java:417)
> 	at org.jboss.cache.interceptors.LockInterceptor.lock(LockInterceptor.java:199)
> 	at org.jboss.cache.interceptors.LockInterceptor.invoke(LockInterceptor.java:144)
> 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:40)
> 	at org.jboss.cache.interceptors.CreateIfNotExistsInterceptor.invoke(CreateIfNotExistsInterceptor.java:145)
> 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:40)
> 	at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:35)
> 	at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:2998)
> 	at org.jboss.cache.TreeCache.put(TreeCache.java:1657)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$MyUpgrader._run(TxDeadlockUnitTestCase.java:346)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$GenericThread.run(TxDeadlockUnitTestCase.java:213)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$GenericThread.run(TxDeadlockUnitTestCase.java:213)
> and
> testConcurrentUpgrade():
> MyThread#1: get(/a/b/c)
> MyThread#2: get(/a/b/c)
> MyThread#2: done, locks: 
> /a	(read owners=[<null>:2])
>     /b	(read owners=[<null>:2])
>         /c	(read owners=[<null>:2])
> MyThread#1: done, locks: 
> /a	(read owners=[<null>:2, <null>:1])
>     /b	(read owners=[<null>:2, <null>:1])
>         /c	(read owners=[<null>:2, <null>:1])
> MyThread#2: put(/a/b/c)
> MyThread#1: put(/a/b/c)
> MyThread#1: org.jboss.cache.lock.LockingException: acquireWriteLock(): lock upgrade failed for /a/b/c (caller=<null>:1); - nested throwable: (org.jboss.cache.lock.UpgradeException: upgradeLockAttempt(): more than one reader trying to simultaneously upgrade to write lock)
> MyThread#2: org.jboss.cache.lock.TimeoutException: upgrade lock for /a/b/c could not be acquired after 3000 ms. Lock map ownership Read lock owners: [<null>:1]
> Write lock owner: null
>  (caller=<null>:2)
> org.jboss.cache.lock.TimeoutException: upgrade lock for /a/b/c could not be acquired after 3000 ms. Lock map ownership Read lock owners: [<null>:1]
> Write lock owner: null
>  (caller=<null>:2)
> 	at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:155)
> 	at org.jboss.cache.Node.acquireWriteLock(Node.java:448)
> 	at org.jboss.cache.Node.acquire(Node.java:417)
> 	at org.jboss.cache.interceptors.LockInterceptor.lock(LockInterceptor.java:199)
> 	at org.jboss.cache.interceptors.LockInterceptor.invoke(LockInterceptor.java:144)
> 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:40)
> 	at org.jboss.cache.interceptors.CreateIfNotExistsInterceptor.invoke(CreateIfNotExistsInterceptor.java:145)
> 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:40)
> 	at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:35)
> 	at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:2998)
> 	at org.jboss.cache.TreeCache.put(TreeCache.java:1657)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$MyThread._run(TxDeadlockUnitTestCase.java:317)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$GenericThread.run(TxDeadlockUnitTestCase.java:213)
> 	at org.jboss.test.cache.test.local.TxDeadlockUnitTestCase$GenericThread.run(TxDeadlockUnitTestCase.java:213)

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

        



More information about the jboss-jira mailing list