Author: ataylor
Date: 2011-06-13 14:30:39 -0400 (Mon, 13 Jun 2011)
New Revision: 10795
Modified:
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
branches/Branch_2_2_EAP-cluster-cleanup/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
Log:
cluster test fixes
Modified:
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
---
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-06-13
12:02:50 UTC (rev 10794)
+++
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-06-13
18:30:39 UTC (rev 10795)
@@ -400,7 +400,7 @@
{
return HandleStatus.NO_MATCH;
}
-
+
synchronized (this)
{
if (!active)
@@ -518,37 +518,44 @@
active = false;
}
- try
- {
+
if (!session.getConnection().isDestroyed())
{
if (beforeReconnect)
{
- synchronized (this)
+ try {
+ synchronized (this)
+ {
+ log.debug(name + "::Connection is destroyed, active = false
now");
+ }
+
+ cancelRefs();
+ }
+ catch (Exception e)
{
- log.debug(name + "::Connection is destroyed, active = false
now");
+ BridgeImpl.log.error("Failed to cancel refs", e);
}
-
- cancelRefs();
}
else
{
- afterConnect();
+ try
+ {
+ afterConnect();
- log.debug(name + "::After reconnect, setting active=true now");
- active = true;
+ log.debug(name + "::After reconnect, setting active=true
now");
+ active = true;
- if (queue != null)
+ if (queue != null)
+ {
+ queue.deliverAsync();
+ }
+ }
+ catch (Exception e)
{
- queue.deliverAsync();
+ BridgeImpl.log.error("Failed to call after connect", e);
}
}
}
- }
- catch (Exception e)
- {
- BridgeImpl.log.error("Failed to cancel refs", e);
- }
}
/* Hook for doing extra stuff after connection */
@@ -709,6 +716,7 @@
if (session != null)
{
session.close();
+ session.removeFailureListener(BridgeImpl.this);
}
synchronized (BridgeImpl.this)
Modified:
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java
===================================================================
---
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-06-13
12:02:50 UTC (rev 10794)
+++
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionBridge.java 2011-06-13
18:30:39 UTC (rev 10795)
@@ -149,8 +149,8 @@
{
if (flowRecord != null)
{
- // TODO: can I really remove this?
- // flowRecord.reset();
+ // TODO: can I really remove this? nope
+ flowRecord.reset();
if (notifConsumer != null)
{
Modified:
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-06-13
12:02:50 UTC (rev 10794)
+++
branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-06-13
18:30:39 UTC (rev 10795)
@@ -544,7 +544,7 @@
}
else
{
- log.info("Reattaching nodeID=" + nodeID);
+ log.info("Reattaching nodeID=" + nodeID);
if (record.isClosed())
{
record.resume();
@@ -787,7 +787,6 @@
isClosed = false;
this.bridge = createBridge(this);
bridge.start();
- bridge.activate();
}
public boolean isClosed()
Modified:
branches/Branch_2_2_EAP-cluster-cleanup/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java
===================================================================
---
branches/Branch_2_2_EAP-cluster-cleanup/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2011-06-13
12:02:50 UTC (rev 10794)
+++
branches/Branch_2_2_EAP-cluster-cleanup/tests/src/org/hornetq/tests/integration/cluster/restart/ClusterRestartTest.java 2011-06-13
18:30:39 UTC (rev 10795)
@@ -69,10 +69,11 @@
printBindings(2);
- sendInRange(1, "queues.testaddress", 0, 10, false, null);
+ sendInRange(1, "queues.testaddress", 0, 10, true, null);
System.out.println("stopping******************************************************");
stopServers(0);
+ Thread.sleep(2000);
System.out.println("stopped******************************************************");
startServers(0);
@@ -87,7 +88,7 @@
sendInRange(1, "queues.testaddress", 10, 20, false, null);
- verifyReceiveAllInRange(10, 20, 0);
+ verifyReceiveAllInRange(0, 20, 0);
System.out.println("*****************************************************************************");
}
finally
Show replies by date