[hornetq-commits] JBoss hornetq SVN: r11093 - in branches/Branch_2_2_EAP_cluster_clean2: src/main/org/hornetq/core/journal/impl and 4 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Aug 1 23:27:37 EDT 2011
Author: clebert.suconic at jboss.com
Date: 2011-08-01 23:27:37 -0400 (Mon, 01 Aug 2011)
New Revision: 11093
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/journal/impl/JournalImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
Log:
tweaks for tests
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -516,6 +516,11 @@
{
checkClosed();
+ if (log.isTraceEnabled())
+ {
+ log.trace("Sending commit");
+ }
+
if (rollbackOnly)
{
rollbackOnFailover();
@@ -928,6 +933,10 @@
if (response.isReattached())
{
+ if (log.isDebugEnabled())
+ {
+ log.debug("ClientSession reattached fine, replaying commands");
+ }
// The session was found on the server - we reattached transparently ok
channel.replayCommands(response.getLastConfirmedCommandID());
@@ -935,6 +944,11 @@
else
{
+ if (log.isDebugEnabled())
+ {
+ log.debug("ClientSession couldn't be reattached, creating a new session");
+ }
+
// The session wasn't found on the server - probably we're failing over onto a backup server where the
// session won't exist or the target server has been restarted - in this case the session will need to be
// recreated,
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/journal/impl/JournalImpl.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -97,7 +97,7 @@
// This is useful at debug time...
// if you set it to true, all the appends, deletes, rollbacks, commits, etc.. are sent to System.out
- private static final boolean TRACE_RECORDS = false;
+ private static final boolean TRACE_RECORDS = trace;
// This method exists just to make debug easier.
// I could replace log.trace by log.info temporarily while I was debugging
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -2560,6 +2560,13 @@
@Override
public String toString()
{
+ // this would be useful when testing. Most tests on the testsuite will use a SimpleString on the duplicate ID
+ // and this may be useful to validate the journal on those tests
+ // You may uncomment these two lines on that case and replcate the toString for the PrintData
+
+ // SimpleString simpleStr = new SimpleString(duplID);
+ // return "DuplicateIDEncoding [address=" + address + ", duplID=" + simpleStr + "]";
+
return "DuplicateIDEncoding [address=" + address + ", duplID=" + Arrays.toString(duplID) + "]";
}
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -1131,14 +1131,12 @@
if (rejectDuplicates && isDuplicate)
{
- StringBuffer warnMessage = new StringBuffer();
- warnMessage.append("Duplicate message detected - message will not be routed. Message information:\n");
- warnMessage.append(message.toString());
- PostOfficeImpl.log.warn(warnMessage.toString());
+ String warnMessage = "Duplicate message detected - message will not be routed. Message information:" + message.toString();
+ PostOfficeImpl.log.warn(warnMessage);
if (context.getTransaction() != null)
{
- context.getTransaction().markAsRollbackOnly(new HornetQException(HornetQException.DUPLICATE_ID_REJECTED, warnMessage.toString()));
+ context.getTransaction().markAsRollbackOnly(new HornetQException(HornetQException.DUPLICATE_ID_REJECTED, warnMessage));
}
return false;
Modified: branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -424,6 +424,10 @@
public void markAsRollbackOnly(final HornetQException exception)
{
+ if (log.isDebugEnabled())
+ {
+ log.debug("Marking Transaction " + this.id + " as rollback only");
+ }
state = State.ROLLBACK_ONLY;
this.exception = exception;
Modified: branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java
===================================================================
--- branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-08-01 21:08:32 UTC (rev 11092)
+++ branches/Branch_2_2_EAP_cluster_clean2/tests/src/org/hornetq/tests/integration/cluster/failover/AsynchronousFailoverTest.java 2011-08-02 03:27:37 UTC (rev 11093)
@@ -181,6 +181,7 @@
locator.setBlockOnNonDurableSend(true);
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
+ locator.setConfirmationWindowSize(10 * 1024 * 1024);
sf = (ClientSessionFactoryInternal) createSessionFactoryAndWaitForTopology(locator, 2);
@@ -209,6 +210,10 @@
// Simulate failure on connection
synchronized (lockFail)
{
+ if (log.isDebugEnabled())
+ {
+ log.debug("#test crashing test");
+ }
crash((ClientSession) createSession);
}
@@ -381,14 +386,14 @@
{
// For duplication detection
int executionId = 0;
-
- log.info("#test doTestTransactional starting now");
-
+
while (!runner.isFailed())
{
ClientSession session = null;
executionId++;
+
+ log.info("#test doTestTransactional starting now. Execution " + executionId);
try
{
@@ -441,13 +446,13 @@
{
if (e.getCode() == HornetQException.DUPLICATE_ID_REJECTED)
{
- logAndSystemOut("#test duplicate id rejected");
+ logAndSystemOut("#test duplicate id rejected on sending");
break;
}
else
if (e.getCode() == HornetQException.TRANSACTION_ROLLED_BACK || e.getCode() == HornetQException.UNBLOCKED)
{
- log.info("#test transaction rollback retrying");
+ log.info("#test transaction rollback retrying on sending");
// OK
retry = true;
}
@@ -460,7 +465,7 @@
}
while (retry);
- logAndSystemOut("Finished sending, starting consumption now");
+ logAndSystemOut("#test Finished sending, starting consumption now");
boolean blocked = false;
@@ -482,6 +487,10 @@
for (int i = 0; i < numMessages; i++)
{
+ if (log.isDebugEnabled())
+ {
+ log.debug("Consumer receiving message " + i);
+ }
ClientMessage message = consumer.receive(10000);
if (message == null)
{
@@ -494,12 +503,18 @@
}
int count = message.getIntProperty("counter");
+
+ if (count != i)
+ {
+ log.warn("count was received out of order, " + count + "!=" + i);
+ }
msgs.add(count);
message.acknowledge();
}
+ log.info("#test commit");
session.commit();
try
@@ -515,6 +530,7 @@
}
catch (Throwable e)
{
+ log.info(threadDump("Thread dump, messagesReceived = " + msgs.size()));
logAndSystemOut(e.getMessage() + " messages received");
for (Integer msg : msgs)
{
More information about the hornetq-commits
mailing list