[hornetq-commits] JBoss hornetq SVN: r11742 - branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 22 16:35:34 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-11-22 16:35:33 -0500 (Tue, 22 Nov 2011)
New Revision: 11742

Modified:
   branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/HornetQChannelHandler.java
Log:
avoiding dead locks

Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/HornetQChannelHandler.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/HornetQChannelHandler.java	2011-11-22 19:31:59 UTC (rev 11741)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/remoting/impl/netty/HornetQChannelHandler.java	2011-11-22 21:35:33 UTC (rev 11742)
@@ -96,19 +96,20 @@
    @Override
    public void exceptionCaught(final ChannelHandlerContext ctx, final ExceptionEvent e) throws Exception
    {
-      synchronized (this)
+      if (!active)
       {
-         if (!active)
-         {
-            return;
-         }
+         return;
+      }
 
-         // We don't want to log this - since it is normal for this to happen during failover/reconnect
-         // and we don't want to spew out stack traces in that event
-         // The user has access to this exeception anyway via the HornetQException initial cause
+      // We don't want to log this - since it is normal for this to happen during failover/reconnect
+      // and we don't want to spew out stack traces in that event
+      // The user has access to this exeception anyway via the HornetQException initial cause
 
-         HornetQException me = new HornetQException(HornetQException.INTERNAL_ERROR, "Netty exception");
-         me.initCause(e.getCause());
+      HornetQException me = new HornetQException(HornetQException.INTERNAL_ERROR, "Netty exception");
+      me.initCause(e.getCause());
+      
+      synchronized (listener)
+      {
          try
          {
             listener.connectionException(e.getChannel().getId(), me);



More information about the hornetq-commits mailing list