activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r443267 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/AbstractConnection.java broker/TransportConnection.java transport/tcp/TcpTransport.java
Date Thu, 14 Sep 2006 06:54:50 GMT
Author: jlim
Date: Wed Sep 13 23:54:49 2006
New Revision: 443267

URL: http://svn.apache.org/viewvc?view=rev&rev=443267
Log:
fixed for http://issues.apache.org/activemq/browse/AMQ-918

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java?view=diff&rev=443267&r1=443266&r2=443267
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
Wed Sep 13 23:54:49 2006
@@ -96,6 +96,7 @@
     
     private WireFormatInfo wireFormatInfo;    
     protected boolean disposed=false;
+    protected IOException transportException;
     
     static class ConnectionState extends org.apache.activemq.state.ConnectionState {
         private final ConnectionContext context;
@@ -176,6 +177,7 @@
     
     public void serviceTransportException(IOException e) {
         if( !disposed ) {
+            transportException = e;	
             if( transportLog.isDebugEnabled() )
                 transportLog.debug("Transport failed: "+e,e);
             ServiceSupport.dispose(this);

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=443267&r1=443266&r2=443267
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Wed Sep 13 23:54:49 2006
@@ -22,13 +22,11 @@
 import org.apache.activemq.broker.ft.MasterBroker;
 import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.command.Command;
-import org.apache.activemq.command.MessageDispatch;
 import org.apache.activemq.command.Response;
 import org.apache.activemq.command.ShutdownInfo;
 import org.apache.activemq.thread.TaskRunnerFactory;
 import org.apache.activemq.transport.DefaultTransportListener;
 import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.TransportListener;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -85,7 +83,12 @@
             if (masterBroker != null){
                 masterBroker.stop();
             }
-            transport.oneway(new ShutdownInfo());
+            
+            // If the transport has not failed yet,
+            // notify the peer that we are doing a normal shutdown.
+            if( transportException == null ) {
+            	transport.oneway(new ShutdownInfo());
+            }
         } catch (Exception ignore) {
             //ignore.printStackTrace();
         }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?view=diff&rev=443267&r1=443266&r2=443267
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Wed Sep 13 23:54:49 2006
@@ -296,11 +296,13 @@
         initializeStreams();
 	}
 
-    protected void doStop(ServiceStopper stopper) throws Exception {    	
-        closeStreams();
+    protected void doStop(ServiceStopper stopper) throws Exception {   
+    	// Closing the streams flush the sockets before closing.. if the socket
+    	// is hung.. then this hangs the close.
+        // closeStreams();
         if (socket != null) {
             socket.close();
-        }
+        }    	
     }
 
     protected void initializeStreams() throws IOException {



Mime
View raw message