JBoss hornetq SVN: r12166 - trunk/hornetq-core/src/main/java/org/hornetq/utils.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2012-02-22 23:40:27 -0500 (Wed, 22 Feb 2012)
New Revision: 12166
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/utils/VersionLoader.java
Log:
add extra debug info
Modified: trunk/hornetq-core/src/main/java/org/hornetq/utils/VersionLoader.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/utils/VersionLoader.java 2012-02-22 22:58:47 UTC (rev 12165)
+++ trunk/hornetq-core/src/main/java/org/hornetq/utils/VersionLoader.java 2012-02-23 04:40:27 UTC (rev 12166)
@@ -15,6 +15,8 @@
import java.io.IOException;
import java.io.InputStream;
+import java.net.URL;
+import java.net.URLClassLoader;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Properties;
@@ -89,7 +91,18 @@
return VersionLoader.version;
}
-
+
+ public static String getClasspathString() {
+ StringBuffer classpath = new StringBuffer();
+ ClassLoader applicationClassLoader = VersionImpl.class.getClassLoader();
+ URL[] urls = ((URLClassLoader)applicationClassLoader).getURLs();
+ for(int i=0; i < urls.length; i++) {
+ classpath.append(urls[i].getFile()).append("\r\n");
+ }
+
+ return classpath.toString();
+ }
+
private static Version load()
{
Properties versionProps = new Properties();
@@ -98,6 +111,7 @@
{
if (in == null)
{
+ log.warn("Classpath: " + getClasspathString());
throw new RuntimeException(VersionLoader.PROP_FILE_NAME + " is not available");
}
try
12 years, 10 months
JBoss hornetq SVN: r12165 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-02-22 17:58:47 -0500 (Wed, 22 Feb 2012)
New Revision: 12165
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java
Log:
fixing test
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java 2012-02-22 21:10:43 UTC (rev 12164)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailBackAutoTest.java 2012-02-22 22:58:47 UTC (rev 12165)
@@ -159,18 +159,15 @@
locator.setFailoverOnInitialConnection(true);
locator.setReconnectAttempts(-1);
ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2);
- CountDownLatch latch = new CountDownLatch(1);
-
+
ClientSession session = sendAndConsume(sf, true);
CountDownSessionFailureListener listener = new CountDownSessionFailureListener();
session.addFailureListener(listener);
- liveServer.crash();
+ liveServer.crash(session);
- assertTrue(latch.await(5, TimeUnit.SECONDS));
-
ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
ClientMessage message = session.createMessage(true);
@@ -279,7 +276,7 @@
if (createQueue)
{
- session.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, false);
+ session.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);
}
ClientProducer producer = session.createProducer(FailoverTestBase.ADDRESS);
12 years, 10 months
JBoss hornetq SVN: r12164 - trunk/native/src.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-02-22 16:10:43 -0500 (Wed, 22 Feb 2012)
New Revision: 12164
Modified:
trunk/native/src/AsyncFile.cpp
Log:
removing unused variable
Modified: trunk/native/src/AsyncFile.cpp
===================================================================
--- trunk/native/src/AsyncFile.cpp 2012-02-22 20:19:39 UTC (rev 12163)
+++ trunk/native/src/AsyncFile.cpp 2012-02-22 21:10:43 UTC (rev 12164)
@@ -111,11 +111,7 @@
LockClass lock(&pollerMutex);
pollerRunning=1;
- struct timespec oneSecond;
- oneSecond.tv_sec = 1;
- oneSecond.tv_nsec = 0;
-
while (pollerRunning)
{
if (isException(threadContext))
12 years, 10 months
JBoss hornetq SVN: r12163 - branches/Branch_2_2_AS7/native/src.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-02-22 15:19:39 -0500 (Wed, 22 Feb 2012)
New Revision: 12163
Modified:
branches/Branch_2_2_AS7/native/src/AsyncFile.cpp
Log:
removing unused variable
Modified: branches/Branch_2_2_AS7/native/src/AsyncFile.cpp
===================================================================
--- branches/Branch_2_2_AS7/native/src/AsyncFile.cpp 2012-02-22 20:00:12 UTC (rev 12162)
+++ branches/Branch_2_2_AS7/native/src/AsyncFile.cpp 2012-02-22 20:19:39 UTC (rev 12163)
@@ -111,11 +111,7 @@
LockClass lock(&pollerMutex);
pollerRunning=1;
- struct timespec oneSecond;
- oneSecond.tv_sec = 1;
- oneSecond.tv_nsec = 0;
-
while (pollerRunning)
{
if (isException(threadContext))
12 years, 10 months
JBoss hornetq SVN: r12162 - branches/Branch_2_2_EAP/native/src.
by do-not-reply@jboss.org
Author: clebert.suconic
Date: 2012-02-22 15:00:12 -0500 (Wed, 22 Feb 2012)
New Revision: 12162
Modified:
branches/Branch_2_2_EAP/native/src/AsyncFile.cpp
Log:
small tweak only
Modified: branches/Branch_2_2_EAP/native/src/AsyncFile.cpp
===================================================================
--- branches/Branch_2_2_EAP/native/src/AsyncFile.cpp 2012-02-22 14:29:10 UTC (rev 12161)
+++ branches/Branch_2_2_EAP/native/src/AsyncFile.cpp 2012-02-22 20:00:12 UTC (rev 12162)
@@ -111,11 +111,7 @@
LockClass lock(&pollerMutex);
pollerRunning=1;
- struct timespec oneSecond;
- oneSecond.tv_sec = 1;
- oneSecond.tv_nsec = 0;
-
while (pollerRunning)
{
if (isException(threadContext))
12 years, 10 months
JBoss hornetq SVN: r12161 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2012-02-22 09:29:10 -0500 (Wed, 22 Feb 2012)
New Revision: 12161
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
Log:
fix test failure
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2012-02-21 22:59:13 UTC (rev 12160)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RedeliveryConsumerTest.java 2012-02-22 14:29:10 UTC (rev 12161)
@@ -209,7 +209,7 @@
session.stop();
// if strictUpdate == true, this will simulate a crash, where the server is stopped without closing/rolling back
- // the session
+ // the session, but the delivery count still persisted, so the final delivery count is 2 too.
if (!strictUpdate)
{
// If non Strict, at least rollback/cancel should still update the delivery-counts
@@ -233,7 +233,7 @@
consumer = session.createConsumer(ADDRESS);
msg = consumer.receive(1000);
Assert.assertNotNull(msg);
- Assert.assertEquals(strictUpdate ? 1 : 2, msg.getDeliveryCount());
+ Assert.assertEquals(strictUpdate ? 2 : 2, msg.getDeliveryCount());
session.close();
}
12 years, 10 months
JBoss hornetq SVN: r12160 - in branches/Branch_2_2_EAP: tests/src/org/hornetq/tests/integration/clientcrash and 1 other directory.
by do-not-reply@jboss.org
Author: jbertram
Date: 2012-02-21 17:59:13 -0500 (Tue, 21 Feb 2012)
New Revision: 12160
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java
Log:
[HORNETQ-865] Rollback for crashed client not updating delivery count properly
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 22:54:57 UTC (rev 12159)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 22:59:13 UTC (rev 12160)
@@ -291,7 +291,7 @@
try
{
- rollback(false);
+ rollback(failed, false);
}
catch (Exception e)
{
@@ -633,8 +633,19 @@
}
}
- public synchronized void rollback(final boolean considerLastMessageAsDelivered) throws Exception
+ public void rollback(final boolean considerLastMessageAsDelivered) throws Exception
{
+ rollback(false, considerLastMessageAsDelivered);
+ }
+
+ /**
+ *
+ * @param clientFailed If the client has failed, we can't decrease the delivery-counts, and the close may issue a rollback
+ * @param considerLastMessageAsDelivered
+ * @throws Exception
+ */
+ private synchronized void rollback(final boolean clientFailed, final boolean considerLastMessageAsDelivered) throws Exception
+ {
if (tx == null)
{
// Might be null if XA
@@ -642,7 +653,7 @@
tx = new TransactionImpl(storageManager, timeoutSeconds);
}
- doRollback(considerLastMessageAsDelivered, tx);
+ doRollback(clientFailed, considerLastMessageAsDelivered, tx);
if (xa)
{
@@ -871,7 +882,7 @@
}
else
{
- doRollback(false, theTx);
+ doRollback(false, false, theTx);
}
}
}
@@ -1367,7 +1378,7 @@
}
}
- private void doRollback(final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
+ private void doRollback(final boolean clientFailed, final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
{
boolean wasStarted = started;
@@ -1380,7 +1391,7 @@
consumer.setStarted(false);
}
- toCancel.addAll(consumer.cancelRefs(false, lastMessageAsDelived, theTx));
+ toCancel.addAll(consumer.cancelRefs(clientFailed, lastMessageAsDelived, theTx));
}
for (MessageReference ref : toCancel)
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java 2012-02-21 22:54:57 UTC (rev 12159)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java 2012-02-21 22:59:13 UTC (rev 12160)
@@ -143,7 +143,7 @@
Assert.assertNotNull("no message received", messageFromClient);
Assert.assertEquals(ClientCrashTest.MESSAGE_TEXT_FROM_CLIENT, messageFromClient.getBodyBuffer().readString());
- assertEquals(1, messageFromClient.getDeliveryCount());
+ assertEquals(2, messageFromClient.getDeliveryCount());
session.close();
12 years, 10 months
JBoss hornetq SVN: r12159 - in branches/Branch_2_2_AS7: tests/src/org/hornetq/tests/integration/clientcrash and 1 other directory.
by do-not-reply@jboss.org
Author: jbertram
Date: 2012-02-21 17:54:57 -0500 (Tue, 21 Feb 2012)
New Revision: 12159
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java
Log:
[HORNETQ-865] Rollback for crashed client not updating delivery count properly
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 22:53:07 UTC (rev 12158)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 22:54:57 UTC (rev 12159)
@@ -291,7 +291,7 @@
try
{
- rollback(false);
+ rollback(failed, false);
}
catch (Exception e)
{
@@ -633,8 +633,19 @@
}
}
- public synchronized void rollback(final boolean considerLastMessageAsDelivered) throws Exception
+ public void rollback(final boolean considerLastMessageAsDelivered) throws Exception
{
+ rollback(false, considerLastMessageAsDelivered);
+ }
+
+ /**
+ *
+ * @param clientFailed If the client has failed, we can't decrease the delivery-counts, and the close may issue a rollback
+ * @param considerLastMessageAsDelivered
+ * @throws Exception
+ */
+ private synchronized void rollback(final boolean clientFailed, final boolean considerLastMessageAsDelivered) throws Exception
+ {
if (tx == null)
{
// Might be null if XA
@@ -642,7 +653,7 @@
tx = new TransactionImpl(storageManager, timeoutSeconds);
}
- doRollback(considerLastMessageAsDelivered, tx);
+ doRollback(clientFailed, considerLastMessageAsDelivered, tx);
if (xa)
{
@@ -871,7 +882,7 @@
}
else
{
- doRollback(false, theTx);
+ doRollback(false, false, theTx);
}
}
}
@@ -1367,7 +1378,7 @@
}
}
- private void doRollback(final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
+ private void doRollback(final boolean clientFailed, final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
{
boolean wasStarted = started;
@@ -1380,7 +1391,7 @@
consumer.setStarted(false);
}
- toCancel.addAll(consumer.cancelRefs(false, lastMessageAsDelived, theTx));
+ toCancel.addAll(consumer.cancelRefs(clientFailed, lastMessageAsDelived, theTx));
}
for (MessageReference ref : toCancel)
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java 2012-02-21 22:53:07 UTC (rev 12158)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/clientcrash/ClientCrashTest.java 2012-02-21 22:54:57 UTC (rev 12159)
@@ -143,7 +143,7 @@
Assert.assertNotNull("no message received", messageFromClient);
Assert.assertEquals(ClientCrashTest.MESSAGE_TEXT_FROM_CLIENT, messageFromClient.getBodyBuffer().readString());
- assertEquals(1, messageFromClient.getDeliveryCount());
+ assertEquals(2, messageFromClient.getDeliveryCount());
session.close();
12 years, 10 months
JBoss hornetq SVN: r12158 - trunk/hornetq-core.
by do-not-reply@jboss.org
Author: clebert.suconic
Date: 2012-02-21 17:53:07 -0500 (Tue, 21 Feb 2012)
New Revision: 12158
Removed:
trunk/hornetq-core/.settings/
Log:
reverting accidental commit
12 years, 10 months
JBoss hornetq SVN: r12157 - in trunk/hornetq-core: src/main/java/org/hornetq/core/server/impl and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-02-21 17:21:51 -0500 (Tue, 21 Feb 2012)
New Revision: 12157
Added:
trunk/hornetq-core/.settings/
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java
Log:
https://issues.jboss.org/browse/HORNETQ-865 - properly updating reference counting in case of failures of the client
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 15:42:48 UTC (rev 12156)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java 2012-02-21 22:21:51 UTC (rev 12157)
@@ -291,7 +291,7 @@
try
{
- rollback(false);
+ rollback(failed, false);
}
catch (Exception e)
{
@@ -634,8 +634,19 @@
}
}
- public synchronized void rollback(final boolean considerLastMessageAsDelivered) throws Exception
+ public void rollback(final boolean considerLastMessageAsDelivered) throws Exception
{
+ rollback(false, considerLastMessageAsDelivered);
+ }
+
+ /**
+ *
+ * @param clientFailed If the client has failed, we can't decrease the delivery-counts, and the close may issue a rollback
+ * @param considerLastMessageAsDelivered
+ * @throws Exception
+ */
+ private synchronized void rollback(final boolean clientFailed, final boolean considerLastMessageAsDelivered) throws Exception
+ {
if (tx == null)
{
// Might be null if XA
@@ -643,7 +654,7 @@
tx = new TransactionImpl(storageManager, timeoutSeconds);
}
- doRollback(considerLastMessageAsDelivered, tx);
+ doRollback(clientFailed, considerLastMessageAsDelivered, tx);
if (xa)
{
@@ -872,7 +883,7 @@
}
else
{
- doRollback(false, theTx);
+ doRollback(false, false, theTx);
}
}
}
@@ -1368,7 +1379,7 @@
}
}
- private void doRollback(final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
+ private void doRollback(final boolean clientFailed, final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
{
boolean wasStarted = started;
@@ -1381,7 +1392,7 @@
consumer.setStarted(false);
}
- toCancel.addAll(consumer.cancelRefs(false, lastMessageAsDelived, theTx));
+ toCancel.addAll(consumer.cancelRefs(clientFailed, lastMessageAsDelived, theTx));
}
for (MessageReference ref : toCancel)
12 years, 10 months