[JBoss JIRA] Created: (ISPN-1258) IllegalMonitorStateException when prepare/commit sequence happens in diff threads
by Galder Zamarreño (JIRA)
IllegalMonitorStateException when prepare/commit sequence happens in diff threads
---------------------------------------------------------------------------------
Key: ISPN-1258
URL: https://issues.jboss.org/browse/ISPN-1258
Project: Infinispan
Issue Type: Bug
Components: Transactions
Affects Versions: 5.0.0.CR8
Reporter: Galder Zamarreño
Assignee: Mircea Markus
Fix For: 5.0.0.FINAL
There's no guarantees at the JGroups level that in a sequence of prepare+commit calls, both will be handled by the same thread as shown in the logs:
Here's a prepare call:
{code}2011-07-20 21:01:44,400 2011 TRACE [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (OOB-1,Infinispan-Cluster,NodeB-10116:) Attempting to execute command: PrepareCommand {gtx=GlobalTransaction:<NodeA-32281>:1:local, modifications=[PutKeyValueCommand{key=a, value=value1, flags=null, putIfAbsent=false, lifespanMillis=-1, maxIdleTimeMillis=-1}], onePhaseCommit=false, gtx=GlobalTransaction:<NodeA-32281>:1:local, cacheName='cache1'} [sender=NodeA-32281]
...
2011-07-20 21:01:44,404 2015 TRACE [org.infinispan.util.concurrent.locks.containers.AbstractPerEntryLockContainer] (OOB-1,Infinispan-Cluster,NodeB-10116:cache1) Acquired lock java.util.concurrent.locks.ReentrantLock@7cd1a1ab[Locked by thread OOB-1,Infinispan-Cluster,NodeB-10116]{code}
And the commit:
{code}2011-07-20 21:01:44,418 2029 TRACE [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (OOB-2,Infinispan-Cluster,NodeB-10116:) Attempting to execute command: CommitCommand {gtx=GlobalTransaction:<NodeA-32281>:1:local, cacheName='cache1'} [sender=NodeA-32281]
...
2011-07-20 21:01:44,423 2034 TRACE [org.infinispan.util.concurrent.locks.containers.AbstractPerEntryLockContainer] (OOB-2,Infinispan-Cluster,NodeB-10116:cache1) Unlock lock java.util.concurrent.locks.ReentrantLock@7cd1a1ab[Locked by thread OOB-1,Infinispan-Cluster,NodeB-10116]{code}
The end result?
{code}
2011-07-20 21:01:44,424 2035 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (OOB-2,Infinispan-Cluster,NodeB-10116:cache1) ISPN000136: Execution error
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:127)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1239)
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:431)
at org.infinispan.util.concurrent.locks.containers.AbstractPerEntryLockContainer.releaseLock(AbstractPerEntryLockContainer.java:113)
at org.infinispan.util.concurrent.locks.LockManagerImpl.unlock(LockManagerImpl.java:113)
at org.infinispan.interceptors.LockingInterceptor.cleanupLocks(LockingInterceptor.java:375)
at org.infinispan.interceptors.LockingInterceptor.visitCommitCommand(LockingInterceptor.java:98)
{code}
Mircea, could you have a look?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira