[jbosscache-commits] JBoss Cache SVN: r5256 - in core/trunk/src/test: resources/META-INF and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jan 29 13:35:52 EST 2008


Author: mircea.markus
Date: 2008-01-29 13:35:51 -0500 (Tue, 29 Jan 2008)
New Revision: 5256

Added:
   core/trunk/src/test/java/org/jboss/cache/AsyncReplicationQueusFailureTest.java
   core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml
Log:


Added: core/trunk/src/test/java/org/jboss/cache/AsyncReplicationQueusFailureTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/AsyncReplicationQueusFailureTest.java	                        (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/AsyncReplicationQueusFailureTest.java	2008-01-29 18:35:51 UTC (rev 5256)
@@ -0,0 +1,38 @@
+package org.jboss.cache;
+
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
+
+/**
+ * Added test to replicate a behavior noticed on certain configs.
+ * N.B. This test is not in its final form, it just reproduced the issue and a more appropriate test should
+ * replace it after narrowing down the issues. The pess-repl-async-issue.xml config file should be deleted aswell.
+ * - guess the issue is caused by using replication q
+ */
+ at Test(groups = "functional") 
+public class AsyncReplicationQueusFailureTest
+{
+   private static final int COUNT = 10;
+   private static final String CONFIG_FILE = "META-INF/pess-repl-async-issue.xml";
+
+   public void testFailure() throws InterruptedException
+   {
+      Cache cache = DefaultCacheFactory.getInstance().createCache(CONFIG_FILE);
+      Cache cache2 = DefaultCacheFactory.getInstance().createCache(CONFIG_FILE);
+      for (int i = 0; i < COUNT; i++)//if we rise the count to 100k then lots of class cast exception are triggered by JGroups threads
+      {
+         System.out.println("on put i = " + i);
+         cache.put("/a/b/c" + i,"key", "value");
+         assertNotNull(cache.get("/a/b/c" + i,"key"));
+      }
+      Thread.sleep(10000);
+      for (int i = 0; i < COUNT; i++)
+      {
+         System.out.println("on get i = " + i);
+         assertNotNull(cache2.get("/a/b/c" + i,"key"));         
+      }
+
+      cache.stop();
+      cache2.stop();
+   }
+}

Added: core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml	                        (rev 0)
+++ core/trunk/src/test/resources/META-INF/pess-repl-async-issue.xml	2008-01-29 18:35:51 UTC (rev 5256)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <mbean code="org.jboss.cache.CacheImpl"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup</attribute>
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+      <attribute name="CacheMode">REPL_ASYNC</attribute>
+      <attribute name="UseReplQueue">true</attribute>
+      <attribute name="ReplQueueInterval">0</attribute>
+      <attribute name="ReplQueueMaxElements">100</attribute>
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+      <attribute name="ClusterConfig">
+         <config>
+            <UDP mcast_addr="232.10.10.10"
+                 mcast_port="45599"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 use_outgoing_packet_handler="false"
+                 ip_ttl="2"
+                 down_thread="false" up_thread="false"
+                 enable_bundling="false"/>
+            <PING timeout="2000"
+                  down_thread="false" up_thread="false" num_initial_members="3"/>
+            <MERGE2 max_interval="100000"
+                    down_thread="false" up_thread="false" min_interval="20000"/>
+            <FD_SOCK down_thread="false" up_thread="false"/>
+            <FD timeout="1000" max_tries="2" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
+            <pbcast.NAKACK max_xmit_size="60000"
+                           use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           down_thread="false" up_thread="false"
+                           discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,1200,2400,3600"
+                     down_thread="false" up_thread="false"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           down_thread="false" up_thread="false"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="3000" use_flush="true" flush_timeout="3000"
+                        down_thread="false" up_thread="false"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true"/>
+            <FC max_credits="2000000" down_thread="false" up_thread="false"
+                min_threshold="0.20"/>
+            <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
+            <!-- <pbcast.STREAMING_STATE_TRANSFER down_thread="false" up_thread="false"
+                                         use_flush="true" flush_timeout="3000" use_reading_thread="true"/> -->
+            <pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="true" flush_timeout="3000"/>
+            <pbcast.FLUSH down_thread="false" up_thread="false" timeout="8000" auto_flush_conf="false"/>
+         </config>
+      </attribute>
+      <attribute name="FetchInMemoryState">false</attribute>
+      <attribute name="InitialStateRetrievalTimeout">15000</attribute>
+      <attribute name="SyncReplTimeout">60000</attribute>
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+      <attribute name="EvictionPolicyConfig">
+      </attribute>
+
+      <attribute name="CacheLoaderConfiguration">
+      </attribute>
+
+      <attribute name="UseRegionBasedMarshalling">false</attribute>
+   </mbean>
+</server>




More information about the jbosscache-commits mailing list