A deadlock found in replication
gaohoward Dec 14, 2012 12:55 AMA deadlock just found in my last test run (which hangs because of it). Here is a piece of stack showing it:
Found one Java-level deadlock:
=============================
"Thread-1693":
waiting for ownable synchronizer 0x00000007e55b47a0, (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync),
which is held by "Thread-28 (HornetQ-server-HornetQServerImpl::ReplicatedPagedFailoverTest/liveServer-623058272)"
"Thread-28 (HornetQ-server-HornetQServerImpl::ReplicatedPagedFailoverTest/liveServer-623058272)":
waiting for ownable synchronizer 0x00000007e4cd3868, (a java.util.concurrent.locks.ReentrantReadWriteLock$FairSync),
which is held by "Thread-1693"
Java stack information for the threads listed above:
===================================================
"Thread-1693":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007e55b47a0> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:807)
at org.hornetq.core.paging.impl.PagingStoreImpl.openNewPage(PagingStoreImpl.java:1080)
at org.hornetq.core.paging.impl.PagingStoreImpl.forceAnotherPage(PagingStoreImpl.java:615)
at org.hornetq.core.persistence.impl.journal.JournalStorageManager.getPageInformationForSync(JournalStorageManager.java:528)
at org.hornetq.core.persistence.impl.journal.JournalStorageManager.startReplication(JournalStorageManager.java:422)
at org.hornetq.core.server.impl.HornetQServerImpl$6.run(HornetQServerImpl.java:2694)
at java.lang.Thread.run(Thread.java:662)
"Thread-28 (HornetQ-server-HornetQServerImpl::ReplicatedPagedFailoverTest/liveServer-623058272)":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007e4cd3868> (a java.util.concurrent.locks.ReentrantReadWriteLock$FairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:594)
at org.hornetq.core.persistence.impl.journal.JournalStorageManager.readLock(JournalStorageManager.java:882)
at org.hornetq.core.persistence.impl.journal.JournalStorageManager.deleteIncrementRecord(JournalStorageManager.java:2085)
at org.hornetq.core.paging.cursor.impl.PageSubscriptionCounterImpl.delete(PageSubscriptionCounterImpl.java:185)
- locked <0x00000007e55b5138> (a org.hornetq.core.paging.cursor.impl.PageSubscriptionCounterImpl)
at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.onPageModeCleared(PageSubscriptionImpl.java:255)
at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl.onPageModeCleared(PageCursorProviderImpl.java:357)
at org.hornetq.core.paging.impl.PagingStoreImpl.stopPaging(PagingStoreImpl.java:507)
at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl.cleanup(PageCursorProviderImpl.java:460)
- locked <0x00000007e55b48a0> (a org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl)
at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl$1.run(PageCursorProviderImpl.java:331)
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:98)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Found 1 deadlock.
Heap
PSYoungGen total 576640K, used 497305K [0x00000007d6c00000, 0x00000007ffba0000, 0x0000000800000000)
eden space 543744K, 85% used [0x00000007d6c00000,0x00000007f31925f8,0x00000007f7f00000)
from space 32896K, 99% used [0x00000007f7f00000,0x00000007f9f13f20,0x00000007f9f20000)
to space 63296K, 0% used [0x00000007fbdd0000,0x00000007fbdd0000,0x00000007ffba0000)
PSOldGen total 220096K, used 72461K [0x0000000784400000, 0x0000000791af0000, 0x00000007d6c00000)
object space 220096K, 32% used [0x0000000784400000,0x0000000788ac3520,0x0000000791af0000)
PSPermGen total 25152K, used 25075K [0x000000077f200000, 0x0000000780a90000, 0x0000000784400000)
object space 25152K, 99% used [0x000000077f200000,0x0000000780a7ced0,0x0000000780a90000)
Idea?