JBoss Cache SVN: r6722 - core/trunk/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-15 07:23:55 -0400 (Mon, 15 Sep 2008)
New Revision: 6722
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updates
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-15 09:49:51 UTC (rev 6721)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-15 11:23:55 UTC (rev 6722)
@@ -2,6 +2,7 @@
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.testng.annotations.Test;
@@ -23,13 +24,19 @@
public void testReplSync() throws Exception
{
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+ cache.getConfiguration().setExposeManagementStatistics(true);
cache.start();
waitForTest();
}
public void testReplAsync() throws Exception
{
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
+ cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
cache.start();
waitForTest();
}
@@ -64,6 +71,10 @@
BuddyReplicationConfig brc = new BuddyReplicationConfig();
brc.setEnabled(true);
cache.getConfiguration().setBuddyReplicationConfig(brc);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+ cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-15 09:49:51 UTC (rev 6721)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-15 11:23:55 UTC (rev 6722)
@@ -5,6 +5,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.util.TestingUtil;
import org.testng.annotations.Test;
@@ -36,12 +37,13 @@
/*
Test configuration options
*/
- protected static final long DURATION = 5 * 60 * 1000; // 15 mins
+ protected static final long DURATION = 60 * 1000; // 1 min of GENERATION = a lot of processing. :-)
protected static final int NUM_THREADS = 15;
- protected static final int MAX_RANDOM_SLEEP_MILLIS = 25;
+ protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
protected static final int MAX_DEPTH = 3;
protected static final int MAX_OVERALL_NODES = 200;
protected static final int WARMUP_LOOPS = 20000;
+ protected static final boolean USE_SLEEP = false; // throttle generation a bit
private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
private Random r = new Random();
@@ -51,6 +53,10 @@
public void testLocalModePess() throws Exception
{
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+ cache.getConfiguration().setConcurrencyLevel(500);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -63,12 +69,17 @@
public void testReplSync() throws Exception
{
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
runCompleteTest();
}
public void testReplAsync() throws Exception
{
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
+ cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -100,6 +111,10 @@
BuddyReplicationConfig brc = new BuddyReplicationConfig();
brc.setEnabled(true);
cache.getConfiguration().setBuddyReplicationConfig(brc);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+ cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
@@ -214,7 +229,9 @@
long duration = System.currentTimeMillis() - startTime;
log.warn("Finished warmup. " + printDuration(duration));
- cache.removeNode(Fqn.ROOT);
+ //cache.removeNode(Fqn.ROOT);
+ cache.stop();
+ cache.start();
}
private void doTest() throws Exception
@@ -240,12 +257,13 @@
break;
}
exec.execute(r);
- TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
+// if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
+ if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
}
log.warn("Finished generating runnables; awaiting executor completion");
// wait for executors to complete!
exec.shutdown();
- exec.awaitTermination(((long) i) * 250, TimeUnit.MILLISECONDS); // wait up to 250 millis for each call?
+ exec.awaitTermination(((long) i), TimeUnit.SECONDS); // wait up to 1 sec for each call?
long duration = System.currentTimeMillis() - startTime;
log.warn("Finished test. " + printDuration(duration));
}
17 years, 1 month
JBoss Cache SVN: r6721 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-15 05:49:51 -0400 (Mon, 15 Sep 2008)
New Revision: 6721
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
Log:
changed config
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 09:48:42 UTC (rev 6720)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 09:49:51 UTC (rev 6721)
@@ -11,7 +11,7 @@
oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="20"
oob_thread_pool.min_threads="8" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
- thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="8"
+ thread_pool.keep_alive_time="10000" thread_pool.max_threads="30" thread_pool.min_threads="8"
thread_pool.queue_enabled="false" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
use_incoming_packet_handler="true"/>
17 years, 1 month
JBoss Cache SVN: r6720 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-15 05:48:42 -0400 (Mon, 15 Sep 2008)
New Revision: 6720
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
Log:
added XML ns
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 09:37:46 UTC (rev 6719)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 09:48:42 UTC (rev 6720)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache>
+<jbosscache xmlns="urn:jboss:jbosscache-core:config:3.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
17 years, 1 month
JBoss Cache SVN: r6719 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-15 05:37:46 -0400 (Mon, 15 Sep 2008)
New Revision: 6719
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
Log:
chnaged config after review with bela
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 08:33:30 UTC (rev 6718)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 09:37:46 UTC (rev 6719)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns="urn:jboss:jbosscache-core:config:3.0">
+<jbosscache>
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
@@ -11,8 +11,8 @@
oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="20"
oob_thread_pool.min_threads="8" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
- thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
- thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+ thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="8"
+ thread_pool.queue_enabled="false" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
use_incoming_packet_handler="true"/>
<PING num_initial_members="3" timeout="2000"/>
17 years, 1 month
JBoss Cache SVN: r6718 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-15 04:33:30 -0400 (Mon, 15 Sep 2008)
New Revision: 6718
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
Log:
chnaged config after review with bela
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-12 22:04:16 UTC (rev 6717)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/conf/mvcc-repl-async.xml 2008-09-15 08:33:30 UTC (rev 6718)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+<jbosscache xmlns="urn:jboss:jbosscache-core:config:3.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
@@ -7,9 +7,9 @@
<jgroupsConfig>
<UDP discard_incompatible_packets="true" enable_bundling="true" enable_diagnostics="false" ip_ttl="2"
loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
- mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
- oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
- oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+ mcast_port="45588" mcast_recv_buf_size="100000000" mcast_send_buf_size="640000"
+ oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="20"
+ oob_thread_pool.min_threads="8" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
@@ -25,14 +25,14 @@
<UNICAST timeout="300,600,1200,2400,3600"/>
<pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
<pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
- view_bundling="true"/>
- <FC max_credits="12000000" min_threshold="0.1"/>
+ view_bundling="true"/>
+ <FC max_credits="5000000" min_threshold="0.2"/>
<FRAG2 frag_size="60000"/>
<pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
<pbcast.FLUSH timeout="0"/>
</jgroupsConfig>
</transport>
<replication>
- <async/>
+ <async />
</replication>
</jbosscache>
17 years, 1 month
JBoss Cache SVN: r6717 - in core/branches/1.4.X: tests/functional/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: jiwils
Date: 2008-09-12 18:04:16 -0400 (Fri, 12 Sep 2008)
New Revision: 6717
Modified:
core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
Log:
Added Takayoshi's patch to JBAS-1406.
Modified: core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-09-12 21:54:20 UTC (rev 6716)
+++ core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-09-12 22:04:16 UTC (rev 6717)
@@ -4308,7 +4308,11 @@
{
if (log.isDebugEnabled()) log.debug("Node " + f + " NOT marked for removal as expected, not removing!");
//also check whether children are marked for deletion, JBCACHE-1406
- Iterator iterator = n.getChildren(true).values().iterator();
+ Map children = n.getChildren(true);
+ if (children == null) {
+ return;
+ }
+ Iterator iterator = children.values().iterator();
while (iterator.hasNext())
{
DataNode data = (DataNode) iterator.next();
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-12 21:54:20 UTC (rev 6716)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-12 22:04:16 UTC (rev 6717)
@@ -72,10 +72,10 @@
assertTrue(!cache.exists("/a/b/c"));
assertTrue(cache.exists("/a/b/d"));
cache.printLockInfo();
- } catch (Exception ex)
- {
- ex.printStackTrace();
+ }
+ catch (Exception ex) {
tm.rollback();
+ throw ex;
}
cache.printLockInfo();
System.out.println(" lock info " + cache.printLockInfo());
@@ -89,8 +89,8 @@
try
{
cache.putFailFast("/a/b/c", "test", "test", 0);
- } catch (Exception ignore)
- {
+ }
+ catch (Exception ignore) {
ignore.printStackTrace();
}
tm.resume(t);
@@ -99,10 +99,10 @@
cache.put("/a/b/c", "test", "test");
print(cache.exists("/a/b/c"));
tm.commit();
- } catch (Exception ex)
- {
- ex.printStackTrace();
+ }
+ catch (Exception ex) {
tm.rollback();
+ throw ex;
}
}
17 years, 1 month
JBoss Cache SVN: r6716 - core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: jiwils
Date: 2008-09-12 17:54:20 -0400 (Fri, 12 Sep 2008)
New Revision: 6716
Modified:
core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java
Log:
Added Takayoshi's patch for JBPAPP-1171 and JBCACHE-1406.
Modified: core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java
===================================================================
--- core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-12 21:53:44 UTC (rev 6715)
+++ core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-12 21:54:20 UTC (rev 6716)
@@ -72,10 +72,10 @@
assertTrue(!cache.exists("/a/b/c"));
assertTrue(cache.exists("/a/b/d"));
cache.printLockInfo();
- } catch (Exception ex)
- {
- ex.printStackTrace();
+ }
+ catch (Exception ex) {
tm.rollback();
+ throw ex;
}
cache.printLockInfo();
System.out.println(" lock info " + cache.printLockInfo());
@@ -89,8 +89,8 @@
try
{
cache.putFailFast("/a/b/c", "test", "test", 0);
- } catch (Exception ignore)
- {
+ }
+ catch (Exception ignore) {
ignore.printStackTrace();
}
tm.resume(t);
@@ -99,10 +99,10 @@
cache.put("/a/b/c", "test", "test");
print(cache.exists("/a/b/c"));
tm.commit();
- } catch (Exception ex)
- {
- ex.printStackTrace();
+ }
+ catch (Exception ex) {
tm.rollback();
+ throw ex;
}
}
17 years, 1 month
JBoss Cache SVN: r6715 - core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: jiwils
Date: 2008-09-12 17:53:44 -0400 (Fri, 12 Sep 2008)
New Revision: 6715
Modified:
core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java
Log:
Added Takayoshi's patch for JBPAPP-1171 and JBCACHE-1406.
Modified: core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java 2008-09-12 21:48:34 UTC (rev 6714)
+++ core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java 2008-09-12 21:53:44 UTC (rev 6715)
@@ -4304,7 +4304,11 @@
{
if (log.isDebugEnabled()) log.debug("Node " + f + " NOT marked for removal as expected, not removing!");
//also check whether children are marked for deletion, JBCACHE-1406
- Iterator iterator = n.getChildren(true).values().iterator();
+ Map children = n.getChildren(true);
+ if (children == null) {
+ return;
+ }
+ Iterator iterator = children.values().iterator();
while (iterator.hasNext())
{
DataNode data = (DataNode) iterator.next();
17 years, 1 month
JBoss Cache SVN: r6714 - in core/support-branches/1.4.1.SP9_JBCACHE-1406: src/org/jboss/cache and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: jiwils
Date: 2008-09-12 17:48:34 -0400 (Fri, 12 Sep 2008)
New Revision: 6714
Added:
core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java
Modified:
core/support-branches/1.4.1.SP9_JBCACHE-1406/build.xml
core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java
Log:
Merged 6690 - 6692 of the 1.4.x Branch for JBPAPP-1171 and JBCACHE-1406.
Modified: core/support-branches/1.4.1.SP9_JBCACHE-1406/build.xml
===================================================================
--- core/support-branches/1.4.1.SP9_JBCACHE-1406/build.xml 2008-09-12 21:40:49 UTC (rev 6713)
+++ core/support-branches/1.4.1.SP9_JBCACHE-1406/build.xml 2008-09-12 21:48:34 UTC (rev 6714)
@@ -392,7 +392,7 @@
<target name="one-test-aop" depends="generateClassLoader, compile,unittests-init"
description="Runs a single unit test">
- <junit printsummary="yes" timeout="${junit.timeout}" fork="yes">
+ <junit printsummary="yes" timeout="${junit.timeout}" fork="yes" maxmemory="512">
<jvmarg value="-Djboss.aop.path=${output.etc.dir}/jboss-aop.xml"/>
<jvmarg value="-Xbootclasspath/p:${bootclasspath}"/>
<!-- start of Optimizeit support
Modified: core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java 2008-09-12 21:40:49 UTC (rev 6713)
+++ core/support-branches/1.4.1.SP9_JBCACHE-1406/src/org/jboss/cache/TreeCache.java 2008-09-12 21:48:34 UTC (rev 6714)
@@ -4303,6 +4303,13 @@
else
{
if (log.isDebugEnabled()) log.debug("Node " + f + " NOT marked for removal as expected, not removing!");
+ //also check whether children are marked for deletion, JBCACHE-1406
+ Iterator iterator = n.getChildren(true).values().iterator();
+ while (iterator.hasNext())
+ {
+ DataNode data = (DataNode) iterator.next();
+ realRemove(data.getFqn(), skipMarkerCheck);
+ }
}
}
Copied: core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java (from rev 6713, core/branches/1.4.X/tests/functional/org/jboss/cache/RemoveOnTxTest.java)
===================================================================
--- core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java (rev 0)
+++ core/support-branches/1.4.1.SP9_JBCACHE-1406/tests/functional/org/jboss/cache/RemoveOnTxTest.java 2008-09-12 21:48:34 UTC (rev 6714)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache;
+
+import junit.framework.TestCase;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
+
+/**
+ * When deleting a node in TX and adding one of it's parrents in same tx, the node node does not get deleted when
+ * tx finishes. This tests is for reproducing the issue above.
+ */
+public class RemoveOnTxTest extends TestCase
+{
+ TreeCache cache;
+ protected void setUp() throws Exception
+ {
+ cache = new TreeCache();
+ PropertyConfigurator config = new PropertyConfigurator();
+ config.configure(cache, "META-INF/local-service.xml");
+ cache.create();
+ cache.start();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ cache.stop();
+ cache.destroy();
+ }
+
+ public void testFailure() throws Exception
+ {
+
+ TransactionManager tm = cache.getTransactionManager();
+ try
+ {
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.remove("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) == null);
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ cache.printLockInfo();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ tm.rollback();
+ }
+ cache.printLockInfo();
+ System.out.println(" lock info " + cache.printLockInfo());
+ try
+ {
+ tm.begin();
+ print(cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ Transaction t = tm.suspend();
+ try
+ {
+ cache.putFailFast("/a/b/c", "test", "test", 0);
+ } catch (Exception ignore)
+ {
+ ignore.printStackTrace();
+ }
+ tm.resume(t);
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print(cache.exists("/a/b/c"));
+ cache.put("/a/b/c", "test", "test");
+ print(cache.exists("/a/b/c"));
+ tm.commit();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ tm.rollback();
+ }
+ }
+
+ private void print(Object s)
+ {
+ System.out.println(s);
+ }
+
+ private void print(boolean s)
+ {
+ System.out.println(s);
+ }
+
+ public void testReal() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.remove("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertNull(cache.peek(Fqn.fromString("/a/b/c")));
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ cache.printLockInfo();
+ }
+
+ public void testSimplified() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) != null);
+ cache.remove("/a/b");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")).getDataKeys().contains("__JBOSS_MARKED_FOR_REMOVAL"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c")) == null);
+ }
+}
17 years, 1 month
JBoss Cache SVN: r6713 - core/support-branches.
by jbosscache-commits@lists.jboss.org
Author: jiwils
Date: 2008-09-12 17:40:49 -0400 (Fri, 12 Sep 2008)
New Revision: 6713
Added:
core/support-branches/1.4.1.SP9_JBCACHE-1406/
Log:
Branch creation for one off patch JBPAPP-1171 and JBCACHE-1406.
Copied: core/support-branches/1.4.1.SP9_JBCACHE-1406 (from rev 6712, core/tags/1.4.1.SP9)
17 years, 1 month