JBoss Cache SVN: r4747 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-13 09:38:17 -0500 (Tue, 13 Nov 2007)
New Revision: 4747
Modified:
core/trunk/pom.xml
Log:
Updated to JGroups 2.6.0.GA
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2007-11-12 15:38:10 UTC (rev 4746)
+++ core/trunk/pom.xml 2007-11-13 14:38:17 UTC (rev 4747)
@@ -21,7 +21,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.0.CR1</version>
+ <version>2.6.0.GA</version>
</dependency>
<dependency>
<groupId>jdbm</groupId>
17 years, 1 month
JBoss Cache SVN: r4746 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-12 10:38:10 -0500 (Mon, 12 Nov 2007)
New Revision: 4746
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/ClusteredCacheLoaderTest.java
Log:
Added some logging
Modified: core/trunk/src/test/java/org/jboss/cache/loader/ClusteredCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/ClusteredCacheLoaderTest.java 2007-11-12 15:37:53 UTC (rev 4745)
+++ core/trunk/src/test/java/org/jboss/cache/loader/ClusteredCacheLoaderTest.java 2007-11-12 15:38:10 UTC (rev 4746)
@@ -13,6 +13,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.lock.TimeoutException;
import org.testng.annotations.AfterMethod;
@@ -244,7 +245,7 @@
cache2.put(fqn, "k", "v");
cache1.evict(fqn);
}
- final int loops = 10000;
+ final int loops = 1000;
final Set<Exception> exceptions = new CopyOnWriteArraySet<Exception>();
Thread evictor = new Thread("Evictor")
@@ -256,8 +257,10 @@
latch.await();
for (int i = 0; i < loops; i++)
{
+ System.out.println("Evict in loop " + i);
Fqn f = singleFqn ? fqn : fqns.get(r.nextInt(fqns.size()));
cache1.evict(f);
+ TestingUtil.sleepRandom(50);
}
}
catch (TimeoutException te)
@@ -282,8 +285,10 @@
latch.await();
for (int i = 0; i < loops; i++)
{
+ System.out.println("Write in loop " + i);
Fqn f = singleFqn ? fqn : fqns.get(r.nextInt(fqns.size()));
cache2.put(f, "k", "v");
+ TestingUtil.sleepRandom(50);
}
}
catch (Exception e)
@@ -305,7 +310,9 @@
latch.await();
for (int i = 0; i < loops; i++)
{
+ System.out.println("R1 in loop " + i);
loader1.get(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())));
+ TestingUtil.sleepRandom(50);
}
}
catch (Exception e)
@@ -325,7 +332,9 @@
latch.await();
for (int i = 0; i < loops; i++)
{
+ System.out.println("R2 in loop " + i);
loader1.getChildrenNames(singleFqn ? fqn.getParent() : fqns.get(r.nextInt(fqns.size())).getParent());
+ TestingUtil.sleepRandom(50);
}
}
catch (Exception e)
@@ -345,7 +354,9 @@
latch.await();
for (int i = 0; i < loops; i++)
{
+ System.out.println("R3 in loop " + i);
loader1.getChildrenNames(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())));
+ TestingUtil.sleepRandom(50);
}
}
catch (Exception e)
17 years, 1 month
JBoss Cache SVN: r4745 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-12 10:37:53 -0500 (Mon, 12 Nov 2007)
New Revision: 4745
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
Additional timeout check
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-12 14:31:00 UTC (rev 4744)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-12 15:37:53 UTC (rev 4745)
@@ -304,6 +304,12 @@
n = cache.getRoot();
treeNodeSize = fqn.size();
+
+ // we need to make sure this loop doesn't take forever (under a lot of concurrency) either as this can seem like a deadlock.
+ // apply a similar timeout check as is done in the loop that calls this lock() method.
+ long expiryTime = System.currentTimeMillis() + timeout;
+ boolean reAcquisitionOnSameNode = false;
+
for (int i = -1; i < treeNodeSize; i++)
{
if (i == -1)
@@ -318,6 +324,9 @@
child_node = n.getChildDirect(child_name);
}
+ // timeout check
+ if (reAcquisitionOnSameNode && System.currentTimeMillis() > expiryTime) throw new TimeoutException("Unable to acquire lock on child node " + new Fqn(n.getFqn(), child_name) + " after " + timeout + " millis.");
+
if (log.isTraceEnabled()) log.trace("Directly got child node " + child_name);
if (child_node == null && createIfNotExists)
{
@@ -373,8 +382,13 @@
// do the loop again, but don't assign child_node to n so that child_node is processed again.
i--;
+ reAcquisitionOnSameNode = true;
continue;
}
+ else
+ {
+ reAcquisitionOnSameNode = false;
+ }
if (recursive && isTargetNode(i, treeNodeSize))
{
17 years, 1 month
Build failed in Hudson: jboss-cache-1.4.X-jdk1.5 #25
by jboss-qa-internal@redhat.com
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-1.4.X-jdk1.5/25/changes
------------------------------------------
started
Building remotely on conf1-linux
FATAL: remote file operation failed
hudson.util.IOException2: remote file operation failed
at hudson.FilePath.act(FilePath.java:276)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:350)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:296)
at hudson.model.AbstractProject.checkout(AbstractProject.java:529)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:213)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:179)
at hudson.model.Run.run(Run.java:579)
at hudson.model.Build.run(Build.java:103)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:62)
Caused by: java.io.IOException: Unable to delete http://hudson.qa.jboss.com/hudson/job/jboss-cache-1.4.X-jdk1.5/ws/ant-dis...
at hudson.Util.deleteFile(Util.java:148)
at hudson.Util.deleteRecursive(Util.java:155)
at hudson.Util.deleteContentsRecursive(Util.java:119)
at hudson.Util.deleteRecursive(Util.java:154)
at hudson.Util.deleteContentsRecursive(Util.java:119)
at hudson.Util.deleteRecursive(Util.java:154)
at hudson.Util.deleteContentsRecursive(Util.java:119)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:393)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:353)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:997)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:200)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
17 years, 1 month
Build failed in Hudson: jboss-cache-1.4.X-jdk1.5 #24
by jboss-qa-internal@redhat.com
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-1.4.X-jdk1.5/24/changes
------------------------------------------
started
Building remotely on conf1-linux
FATAL: remote file operation failed
hudson.util.IOException2: remote file operation failed
at hudson.FilePath.act(FilePath.java:276)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:350)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:296)
at hudson.model.AbstractProject.checkout(AbstractProject.java:529)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:213)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:179)
at hudson.model.Run.run(Run.java:579)
at hudson.model.Build.run(Build.java:103)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:62)
Caused by: java.io.IOException: Unable to delete http://hudson.qa.jboss.com/hudson/job/jboss-cache-1.4.X-jdk1.5/ws/ant-dis...
at hudson.Util.deleteFile(Util.java:148)
at hudson.Util.deleteRecursive(Util.java:155)
at hudson.Util.deleteContentsRecursive(Util.java:119)
at hudson.Util.deleteRecursive(Util.java:154)
at hudson.Util.deleteContentsRecursive(Util.java:119)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:393)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:353)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:997)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:200)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
17 years, 1 month
JBoss Cache SVN: r4744 - core/branches/1.4.X.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-12 09:31:00 -0500 (Mon, 12 Nov 2007)
New Revision: 4744
Modified:
core/branches/1.4.X/build.xml
Log:
Increased JUnit test max memory
Modified: core/branches/1.4.X/build.xml
===================================================================
--- core/branches/1.4.X/build.xml 2007-11-09 15:03:06 UTC (rev 4743)
+++ core/branches/1.4.X/build.xml 2007-11-12 14:31:00 UTC (rev 4744)
@@ -46,8 +46,8 @@
<property name="junit.timeout.stresstest" value="6000000"/>
<property name="junit.timeout.performance" value="60000"/>
<property name="junit.timeout.compat" value="300000"/>
+ <property name="junit.maxmem" value="1024M"/>
<property name="junit.batchtest.todir" value="${build.reports}"/>
- <property name="junit.jvm.options" value="-Ddummy"/>
<property name="ant.dir" value="${root.dir}/ant-dist"/>
<property name="manifest.file" value="${dist.lib}/default.mf"/>
<!-- Test if JDK5 is available -->
@@ -748,7 +748,7 @@
</target>
<target name="perftests" depends="compile,unittests-init" description="Runs all non-AOP perf tests">
- <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
+ <junit printsummary="yes" timeout="${junit.timeout}" fork="yes" maxmemory="${junit.maxmem}">
<classpath refid="library.classpath"/>
<classpath refid="output.classpath"/>
<jvmarg value="-Dbind.address=${bind.address}"/>
@@ -774,7 +774,7 @@
</target>
<target name="stresstests" depends="compile,unittests-init" description="Runs all non-AOP perf tests">
- <junit printsummary="yes" timeout="${junit.timeout.stresstest}" fork="yes">
+ <junit printsummary="yes" timeout="${junit.timeout.stresstest}" fork="yes" maxmemory="${junit.maxmem}">
<classpath refid="library.classpath"/>
<classpath refid="output.classpath"/>
<jvmarg value="-Dbind.address=${bind.address}"/>
@@ -874,7 +874,7 @@
description="The config file name passed to the cache"/>
<sequential>
<echo message="Running tests with a @{name} JBossCache instance with @{conf}"/>
- <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
+ <junit printsummary="yes" timeout="${junit.timeout}" fork="yes" maxmemory="${junit.maxmem}">
<classpath refid="@{classpath}"/>
<sysproperty key="interop.test.config" value="@{conf}"/>
<formatter type="xml" usefile="true" extension="-(a){desc}.xml"/>
@@ -900,8 +900,7 @@
<equals arg1="${ant.java.version}" arg2="1.4"/>
</condition>
- <junit printsummary="yes" timeout="${junit.timeout.compat}" fork="yes"
- maxmemory="256m">
+ <junit printsummary="yes" timeout="${junit.timeout.compat}" fork="yes" maxmemory="${junit.maxmem}">
<classpath>
<pathelement path="${compiletest.dir}"/>
</classpath>
17 years, 1 month
JBoss Cache SVN: r4743 - core/trunk/src/test/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-11-09 10:03:06 -0500 (Fri, 09 Nov 2007)
New Revision: 4743
Modified:
core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
Log:
updated tests to reflect the fact that removals now create the missing nodes(i.e. also acquire the locks accordingly)
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2007-11-09 11:47:55 UTC (rev 4742)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/TransactionTest.java 2007-11-09 15:03:06 UTC (rev 4743)
@@ -448,9 +448,13 @@
// /a/b, /a/b/c should NOT be created!
GlobalTransaction gtx = cache.getCurrentTransaction();
assertLocked(gtx, "/", false);
- assertLocked(gtx, "/a", false);
- assertNull("/a/b should not exist", cache.peek(Fqn.fromString("/a/b"), true));
- assertNull("/a/b/c should not exist", cache.peek(Fqn.fromString("/a/b/c"), true));
+ assertLocked(gtx, "/a", true);
+ assertLocked(gtx, "/a/b", true);
+ assertLocked(gtx, "/a/b/c", true);
+ assertNotNull("/a/b should exist", cache.peek(Fqn.fromString("/a/b"), true));
+ assertNotNull("/a/b/c should exist", cache.peek(Fqn.fromString("/a/b/c"), true));
+ assertNotNull("/a/b should NOT be visible", cache.exists(Fqn.fromString("/a/b")));
+ assertNotNull("/a/b/c should NOT be visible", cache.exists(Fqn.fromString("/a/b/c")));
tx.rollback();
assertNull("/a/b should not exist", cache.peek(Fqn.fromString("/a/b"), true));
assertNull("/a/b/c should not exist", cache.peek(Fqn.fromString("/a/b/c"), true));
17 years, 1 month
JBoss Cache SVN: r4742 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-11-09 06:47:55 -0500 (Fri, 09 Nov 2007)
New Revision: 4742
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
fixed following issue on lock acquisition : if createIfNorExist, try acquire a lock untill it exists, disregarding the fact that it was deleted or not.
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-09 02:00:46 UTC (rev 4741)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-09 11:47:55 UTC (rev 4742)
@@ -193,7 +193,7 @@
created = lock(ctx, fqn, lock_type, recursive, createIfNotExists, timeout, isDeleteOperation, isEvictOperation, isRemoveDataOperation);
firstTry = false;
}
- while (createIfNotExists && cache.peek(fqn, false) == null);// keep trying until we have the lock (fixes concurrent remove())
+ while (createIfNotExists && cache.peek(fqn, true) == null);// keep trying until we have the lock (fixes concurrent remove())
}
}
else if (!lockNecessary)
17 years, 1 month
JBoss Cache SVN: r4741 - in core/trunk/src: test/java/org/jboss/cache/lock/pessimistic and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-11-08 21:00:46 -0500 (Thu, 08 Nov 2007)
New Revision: 4741
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
Log:
Fixed return value for removeNode operations and reduced test iterations
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-08 15:40:14 UTC (rev 4740)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-09 02:00:46 UTC (rev 4741)
@@ -177,6 +177,7 @@
// If no TX: add each acquired lock to the list of locks for this method (locks)
// If TX: [merge code from TransactionInterceptor]: register with TxManager, on commit/rollback,
// release the locks for the given TX
+ boolean created = false;
if (fqn != null)
{
if (!locksAlreadyObtained)
@@ -189,7 +190,7 @@
{
// this is an additional check to make sure we don't try for too long.
if (!firstTry && System.currentTimeMillis() > cutoffTime) throw new TimeoutException("Unable to acquire lock on Fqn " + fqn + " after " + timeout + " millis");
- lock(ctx, fqn, lock_type, recursive, createIfNotExists, timeout, isDeleteOperation, isEvictOperation, isRemoveDataOperation);
+ created = lock(ctx, fqn, lock_type, recursive, createIfNotExists, timeout, isDeleteOperation, isEvictOperation, isRemoveDataOperation);
firstTry = false;
}
while (createIfNotExists && cache.peek(fqn, false) == null);// keep trying until we have the lock (fixes concurrent remove())
@@ -229,7 +230,8 @@
{
cleanup(ctx.getGlobalTransaction());
}
- return o;
+ // if this is a delete op and we had to create the node, return a FALSE as nothing *really* was deleted!
+ return isDeleteOperation && created ? false : o;
}
private long getLockAcquisitionTimeout(InvocationContext ctx)
@@ -267,8 +269,9 @@
* @param fqn
* @param lock_type DataNode.LOCK_TYPE_READ, DataNode.LOCK_TYPE_WRITE or DataNode.LOCK_TYPE_NONE
* @param recursive Lock children recursively
+ * @return true if the node had to be created
*/
- private void lock(InvocationContext ctx, Fqn fqn, NodeLock.LockType lock_type, boolean recursive, boolean createIfNotExists, long timeout, boolean isDeleteOperation, boolean isEvictionOperation, boolean isRemoveDataOperation)
+ private boolean lock(InvocationContext ctx, Fqn fqn, NodeLock.LockType lock_type, boolean recursive, boolean createIfNotExists, long timeout, boolean isDeleteOperation, boolean isEvictionOperation, boolean isRemoveDataOperation)
throws TimeoutException, LockingException, InterruptedException
{
NodeSPI n;
@@ -276,6 +279,7 @@
Object child_name;
Thread currentThread = Thread.currentThread();
GlobalTransaction gtx = ctx.getGlobalTransaction();
+ boolean created = false;
// if the tx associated with the current thread is rolling back, barf! JBCACHE-923
if (gtx != null)
{
@@ -290,7 +294,7 @@
if (fqn == null)
{
log.error("fqn is null - this should not be the case");
- return;
+ return false;
}
if (configuration.getIsolationLevel() == IsolationLevel.NONE)
@@ -314,7 +318,6 @@
child_node = n.getChildDirect(child_name);
}
- boolean created = false;
if (log.isTraceEnabled()) log.trace("Directly got child node " + child_name);
if (child_node == null && createIfNotExists)
{
@@ -329,7 +332,7 @@
{
log.trace("failed to find or create child " + child_name + " of node " + n);
}
- return;
+ return false;
}
NodeLock.LockType lockTypeRequired;
@@ -394,6 +397,8 @@
// Add the Fqn to be removed to the transaction entry so we can clean up after ourselves during commit/rollback
if (isDeleteOperation && gtx != null) cache.getTransactionTable().get(gtx).addRemovedNode(fqn);
+
+ return created;
}
private boolean needToReverseRemove(NodeSPI n, TransactionEntry te, NodeLock.LockType lockTypeRequested, boolean isRemoveOperation, boolean createIfNotExists)
Modified: core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2007-11-08 15:40:14 UTC (rev 4740)
+++ core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2007-11-09 02:00:46 UTC (rev 4741)
@@ -51,7 +51,7 @@
}
}
- @Test (invocationCount = 50)
+ @Test
public void testLock() throws Exception {
for (int x = 0; x < 2; x++) {
SeparateThread t = new SeparateThread(x);
17 years, 1 month