[infinispan-issues] [JBoss JIRA] (ISPN-2378) IllegalMonitorStateException when using LockSupportCacheStore.loadAllKeys

Thomas Fromm (JIRA) jira-events at lists.jboss.org
Mon Nov 26 15:05:21 EST 2012


    [ https://issues.jboss.org/browse/ISPN-2378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737120#comment-12737120 ] 

Thomas Fromm commented on ISPN-2378:
------------------------------------

So results:
In LockSupportCacheStore the results of aquireGlobal were ignored inside loadAllKeys (and some other methods). In some case aquireGlobal(...) returns false, the locks are already released, so the finally block tries again to release them.

It was just needed to make sure, that in case of aquireGlobal(...)==false releaseGlobalLock(false) is not called inside the finally.

I tried to find an easy way to simulate such situation, but I found no simple way to mock this behaviour in a useful manner. So I created PR without unit test.
I attached an test to this ticket, where the problem runs into error, when the PR is not applied. This test is not really useful as unit test. 
                
> IllegalMonitorStateException when using LockSupportCacheStore.loadAllKeys
> -------------------------------------------------------------------------
>
>                 Key: ISPN-2378
>                 URL: https://issues.jboss.org/browse/ISPN-2378
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Loaders and Stores
>    Affects Versions: 5.2.0.Beta1
>            Reporter: Thomas Fromm
>            Assignee: Thomas Fromm
>            Priority: Critical
>         Attachments: ISPN2378.java
>
>
> When accessing cache store from different threads:
> java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread
>         at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:447)
>         at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:431)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
>         at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:883)
>         at org.infinispan.util.concurrent.locks.StripedLock.releaseGlobalLock(StripedLock.java:243)
>         at org.infinispan.loaders.LockSupportCacheStore.releaseGlobalLock(LockSupportCacheStore.java:134)
>         at org.infinispan.loaders.LockSupportCacheStore.loadAllKeys(LockSupportCacheStore.java:177)
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list