Author: clebert.suconic(a)jboss.com
Date: 2011-07-06 00:45:46 -0400 (Wed, 06 Jul 2011)
New Revision: 10927
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
changes on my branch (fixing test)
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2011-07-05
16:59:31 UTC (rev 10926)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/impl/invm/InVMConnection.java 2011-07-06
04:45:46 UTC (rev 10927)
@@ -12,8 +12,10 @@
*/
package org.hornetq.core.remoting.impl.invm;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQBuffers;
@@ -139,7 +141,7 @@
}
catch (Exception e)
{
- final String msg = "Failed to write to handler";
+ final String msg = "Failed to write to handler on connector "
+ this;
InVMConnection.log.error(msg, e);
throw new IllegalStateException(msg, e);
}
@@ -150,6 +152,26 @@
{
// Ignore - this can happen if server/client is shutdown and another request
comes in
}
+
+ if (flush)
+ {
+ final CountDownLatch latch = new CountDownLatch(1);
+ executor.execute(new Runnable(){
+ public void run()
+ {
+ latch.countDown();
+ }
+ });
+
+ try
+ {
+ latch.await(10, TimeUnit.SECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ log.debug(e.getMessage(), e);
+ }
+ }
}
public String getRemoteAddress()
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-07-05
16:59:31 UTC (rev 10926)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2011-07-06
04:45:46 UTC (rev 10927)
@@ -64,6 +64,8 @@
// Constants -----------------------------------------------------
private static final Logger log = Logger.getLogger(RemotingServiceImpl.class);
+
+ private static final boolean isTrace = log.isTraceEnabled();
public static final long CONNECTION_TTL_CHECK_INTERVAL = 2000;
@@ -369,6 +371,11 @@
ConnectionEntry entry = pmgr.createConnectionEntry(connection);
+ if (isTrace)
+ {
+ log.trace("Connection created " + connection);
+ }
+
connections.put(connection.getID(), entry);
if (config.isBackup())
@@ -379,6 +386,12 @@
public void connectionDestroyed(final Object connectionID)
{
+
+ if (isTrace)
+ {
+ log.trace("Connection removed " + connectionID, new Exception
("trace"));
+ }
+
ConnectionEntry conn = connections.get(connectionID);
if (conn != null)
@@ -458,6 +471,13 @@
{
conn.connection.bufferReceived(connectionID, buffer);
}
+ else
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace("ConnectionID = " + connectionID + " was already
closed, so ignoring packet");
+ }
+ }
}
}
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-05
16:59:31 UTC (rev 10926)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2011-07-06
04:45:46 UTC (rev 10927)
@@ -518,7 +518,7 @@
public final void connectionFailed(final HornetQException me, boolean failedOver)
{
- log.warn(this + "::Connection failed with failedOver=" + failedOver +
"-" + me, me);
+ log.warn(this + "::Connection failed with failedOver=" + failedOver +
"-" + me, new Exception (me.getMessage()));
try
{
@@ -777,6 +777,8 @@
{
try
{
+ log.debug("stopping bridge " + BridgeImpl.this);
+
if (session != null)
{
log.debug("Cleaning up session " + session);
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-05
16:59:31 UTC (rev 10926)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-07-06
04:45:46 UTC (rev 10927)
@@ -594,7 +594,7 @@
if (log.isDebugEnabled())
{
- log.debug("PORRA creating record between " + this.connector + "
and " + connector + bridge);
+ log.debug("creating record between " + this.connector + " and
" + connector + bridge);
}
record.setBridge(bridge);