[jbosscache-issues] [JBoss JIRA] Commented: (JBCACHE-1565) Locking doesn't work when replication is used
Brett Cave (JIRA)
jira-events at lists.jboss.org
Fri Mar 12 08:33:38 EST 2010
[ https://jira.jboss.org/jira/browse/JBCACHE-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12519595#action_12519595 ]
Brett Cave commented on JBCACHE-1565:
-------------------------------------
the same exception occurs when using pojocache (3.0, core 3.1 "casabel") that is distributed with JBoss AS5.
* Pojocache configured via JMX (pojocache-service.xml) with JBossTransactionManagerLookup class and REPL_SYNC (other variations not tested).
* Retrieve reference to PojoCache via the JmxWrapper, and attach a pojo to the cache.
The exception occurs.
Disabling the transactionmanager on the cache results in a different exception:
Caused by: com.test.system.exception.MyPojoCacheException: Error writing to pojo cache: /cache/9ec2c1bb-e37f-4592-9348-953dc164ed04
at com.test.system.session.PojoCacheManagerBean.writeToCache(PojoCacheManagerBean.java:42)
....
Caused by: org.jboss.cache.pojo.PojoCacheException: attach failed /cache/9ec2c1bb-e37f-4592-9348-953dc164ed04
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:111)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:93)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:88)
at com.test.system.session.PojoCacheManagerBean.writeToCache(PojoCacheManagerBean.java:39)
... 246 more
Caused by: org.jboss.cache.CacheException: java.io.EOFException
at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:304)
at org.jboss.cache.invocation.CacheInvocationDelegate.invokePut(CacheInvocationDelegate.java:705)
at org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:519)
at org.jboss.cache.pojo.impl.InternalHelper.put(InternalHelper.java:110)
at org.jboss.cache.pojo.impl.SerializableObjectHandler.putIntoCache(SerializableObjectHandler.java:86)
at org.jboss.cache.pojo.impl.SerializableObjectHandler.put(SerializableObjectHandler.java:71)
at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObject(PojoCacheDelegate.java:138)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:102)
... 249 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
> Locking doesn't work when replication is used
> ---------------------------------------------
>
> Key: JBCACHE-1565
> URL: https://jira.jboss.org/jira/browse/JBCACHE-1565
> Project: JBoss Cache
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.2.1.GA
> Environment: Linux, Sun Java 5.0
> Reporter: tbech
> Assignee: Mircea Markus
> Priority: Critical
> Attachments: ConcurrentWritersTest.java, exc.txt, GetPutCachebenchCluster.xml, GetPutTest.java, JBossCache321Wrapper.java, mvcc-repl-sync.xml
>
>
> During performance tests of JBossCache, I've tried to test transactions with cache.getInvocationContext().getOptionOverrides().setForceWriteLock operation ('select-for-update'). I've used standard jbosscache benchmark from svn. I've created new product jbosscache3.2.1 based on 3.1.0 and new test. Basicaly it did:
> try
> {
> long startTime = System.nanoTime();
> if (concurrentWrites) {
> cacheWrapper.startTransaction();
> cacheWrapper.setForceWriteLock(true);
> }
> ObjectInCache o = (ObjectInCache) cacheWrapper.get(path, key);
> o = new ObjectInCache(Integer.valueOf(o.getVal().intValue() + 1), randStr[taskNumber%randStr.length]);
> cacheWrapper.put(path, key, o);
> if (concurrentWrites) {
> cacheWrapper.endTransaction(true);
> }
> long statValue = (System.nanoTime() - startTime);
> descriptiveStatistics.addValue(statValue);
> }
> catch (Throwable e)
> {
> log.error("Error appeared whilst writing to cache:" + e.getMessage(), e);
> try {
> if (concurrentWrites) {
> cacheWrapper.endTransaction(false);
> }
> } finally {
>
> }
> } finally {
> logRunCount(taskNumber);
> }
> concurrentWrites was set to true.
> This tests passes nicely in one node (local mode). However in 2,3,4 nodes it fails after first usage of the same object by different node with exception:
> org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn [/concurrent/Intermediate-0/Node 0] after [240000] milliseconds for requestor [GlobalTransaction:<10.118.236.212:40325>:0]! Lock held by [GlobalTransaction:<10.118.236.211:8112>:40]
> at org.jboss.cache.mvcc.MVCCNodeHelper.acquireLock(MVCCNodeHelper.java:159)
> It looks like, in replication the node is not beeing releases after transaction commit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosscache-issues
mailing list