[hornetq-commits] JBoss hornetq SVN: r11203 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Aug 13 03:45:59 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-08-13 03:45:59 -0400 (Sat, 13 Aug 2011)
New Revision: 11203

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
reverting last change on ClientSessionFActory (wrong commit, sorry about this entry)

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-08-13 07:07:31 UTC (rev 11202)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-08-13 07:45:59 UTC (rev 11203)
@@ -1399,19 +1399,26 @@
                log.trace("Disconnect being called on client:" + msg + " server locator = " + serverLocator, new Exception ("trace"));
             }
 
-            conn.fail(new HornetQException(HornetQException.DISCONNECTED,
-                                           "The connection was disconnected because of server shutdown"));
-            
-            SimpleString nodeID = msg.getNodeID();
-            if (log.isTraceEnabled())
+            closeExecutor.execute(new Runnable()
             {
-               log.trace("notifyDown nodeID=" + msg.getNodeID() + " on serverLocator=" + serverLocator + " csf created at ", ClientSessionFactoryImpl.this.e);
-            }
-            if (nodeID != null)
-            {
-               serverLocator.notifyNodeDown(msg.getNodeID().toString());
-            }
+               // Must be executed on new thread since cannot block the netty thread for a long time and fail can
+               // cause reconnect loop
+               public void run()
+               {
+                  conn.fail(new HornetQException(HornetQException.DISCONNECTED,
+                                                 "The connection was disconnected because of server shutdown"));
 
+                  SimpleString nodeID = msg.getNodeID();
+                  if (log.isTraceEnabled())
+                  {
+                     log.trace("notifyDown nodeID=" + msg.getNodeID() + " on serverLocator=" + serverLocator + " csf created at ", ClientSessionFactoryImpl.this.e);
+                  }
+                  if (nodeID != null)
+                  {
+                     serverLocator.notifyNodeDown(msg.getNodeID().toString());
+                  }
+               }
+            });
          }
          else if (type == PacketImpl.CLUSTER_TOPOLOGY)
          {



More information about the hornetq-commits mailing list