[infinispan-dev] Concurrency problem on org.infinispan.transaction.xa.TransactionTable
Erik Salter
esalter at bnivideo.com
Fri Jan 21 09:20:40 EST 2011
Hi guys,
What ISPN version are you using? The 4.2.1.CR1 branch and the main branch both use a ConcurrentHashMap for local and remote transactions.
(Apologies if this has already been answered)
Regards,
Erik
-----Original Message-----
From: infinispan-dev-bounces at lists.jboss.org [mailto:infinispan-dev-bounces at lists.jboss.org] On Behalf Of Sebastiano Peluso
Sent: Thursday, January 20, 2011 2:07 PM
To: infinispan -Dev List
Subject: Re: [infinispan-dev] Concurrency problem on org.infinispan.transaction.xa.TransactionTable
Il 20/01/11 18:45, Sebastiano Peluso ha scritto:
> Hi all!
> We are Diego and Sebastiano and we are working in the Cloud-TM
> project; in particular we are focusing on designing new replication
> schemes in Infinispan. During our code inspection we have noted that
> Infinispan can suffer from a concurrency issue: multiple threads in
> execution on the same local cache instance can access without any
> synchronization scheme on a
> org.infinispan.transaction.xa.TransactionTable's field named
> localTransactions; the problem is that the aforementioned
> localTransactions field is an instance of HashMap, which isn't
> thread-safe. We have noticed the problem during some intensive tests
> (executed with a version of RadarGun modified by us in order to enable
> transactions executions) which stressed heavily the cache with
> concurrent threads: in some cases all threads on some nodes blocked in
> an infinite loop on a get() operation on the aforementioned HashMap instance.
> We attach the dump relevant to a single blocked node and you can note
> that each thread, namely a Stresser, is blocked on the get() operation.
> We have noted the same concurrency problem on the field
> remoteTransactions in the same object.
> To partially validate our hypothesis we have replaced the type HashMap
> with ConcurrentHashMap and everithing works fine.
> What is your opinion about this?
>
> Best regards
> Diego, Sebastiano
>
>
>
>
>
> "Stresser-7" prio=10 tid=0x00007fb2c0295000 nid=0x5bd3 runnable
> [0x00007fb2c6bea000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-6" prio=10 tid=0x00007fb2c0293000 nid=0x5bd2 runnable
> [0x00007fb2c6ceb000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-5" prio=10 tid=0x00007fb2c0292000 nid=0x5bd1 runnable
> [0x00007fb2c6dec000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-4" prio=10 tid=0x00007fb2c0291800 nid=0x5bd0 runnable
> [0x00007fb2c77f6000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-3" prio=10 tid=0x00007fb2c0290800 nid=0x5bcf runnable
> [0x00007fb2c78f7000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-2" prio=10 tid=0x00007fb2c0044000 nid=0x5bce runnable
> [0x00007fb2c76f5000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-1" prio=10 tid=0x00007fb2c0043000 nid=0x5bcd runnable
> [0x00007fb2c74f3000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367)
>
> "Stresser-0" prio=10 tid=0x00007fb2c0048000 nid=0x5bcc runnable
> [0x00007fb2c75f4000]
> java.lang.Thread.State: RUNNABLE
> at java.util.HashMap.get(HashMap.java:303)
> at
> org.infinispan.transaction.xa.TransactionTable.getXaCacheAdapter(TransactionTable.java:222)
> at
> org.infinispan.context.InvocationContextContainerImpl.createInvocationContext(InvocationContextContainerImpl.java:67)
> at
> org.infinispan.CacheDelegate.getInvocationContext(CacheDelegate.java:285)
> at org.infinispan.CacheDelegate.get(CacheDelegate.java:199)
> at
> org.radargun.cachewrappers.InfinispanWrapper.get(InfinispanWrapper.java:99)
> at
> org.radargun.stressors.PutGetStressor$Stresser.run(PutGetStressor.java
> :367) _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
Hi all again,
but we have seen that the problem is already fixed in the last stable release (4.2.0). We were using the 4.1.0 version beceause when we have started to work in Infinispan the last stable was 4.1.0.
We are sorry!
Best regards
Sebastiano, Diego
_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
The information contained in this message is legally privileged and confidential, and is intended for the individual or entity to whom it is addressed (or their designee). If this message is read by anyone other than the intended recipient, please be advised that distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete or destroy all copies of this message.
More information about the infinispan-dev
mailing list