activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r443278 - in /incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq: broker/AbstractConnection.java broker/TransportConnection.java transport/tcp/TcpTransport.java
Date Thu, 14 Sep 2006 07:35:34 GMT
Author: jlim
Date: Thu Sep 14 00:35:33 2006
New Revision: 443278

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

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

Modified: incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java?view=diff&rev=443278&r1=443277&r2=443278
==============================================================================
--- incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
(original)
+++ incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
Thu Sep 14 00:35:33 2006
@@ -91,6 +91,7 @@
     
     private WireFormatInfo wireFormatInfo;    
     protected boolean disposed=false;
+    protected IOException transportException;
     
     static class ConnectionState extends org.apache.activemq.state.ConnectionState {
         private final ConnectionContext context;
@@ -167,6 +168,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/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=443278&r1=443277&r2=443278
==============================================================================
--- incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Thu Sep 14 00:35:33 2006
@@ -21,13 +21,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;
 
@@ -84,7 +82,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/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?view=diff&rev=443278&r1=443277&r2=443278
==============================================================================
--- incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ incubator/activemq/branches/activemq-4.0.2/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Thu Sep 14 00:35:33 2006
@@ -280,7 +280,9 @@
     }
 
     protected void doStop(ServiceStopper stopper) throws Exception {
-        closeStreams();
+    	// Closing the streams flush the sockets before closing.. if the socket
+    	// is hung.. then this hangs the close.
+        // closeStreams();
         if (socket != null) {
             socket.close();
         }



Mime
View raw message