activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r932403 - in /activemq/trunk: activemq-core/ activemq-core/src/main/java/org/apache/activemq/transport/vm/ assembly/src/release/conf/ assembly/src/release/webapps/camel/WEB-INF/
Date Fri, 09 Apr 2010 13:31:36 GMT
Author: dejanb
Date: Fri Apr  9 13:31:36 2010
New Revision: 932403

URL: http://svn.apache.org/viewvc?rev=932403&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-2448 - thread leak when network trying to connect
to unavailable broker

Modified:
    activemq/trunk/activemq-core/pom.xml
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
    activemq/trunk/assembly/src/release/conf/camel.xml
    activemq/trunk/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml

Modified: activemq/trunk/activemq-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/pom.xml?rev=932403&r1=932402&r2=932403&view=diff
==============================================================================
--- activemq/trunk/activemq-core/pom.xml (original)
+++ activemq/trunk/activemq-core/pom.xml Fri Apr  9 13:31:36 2010
@@ -530,9 +530,6 @@
             <!-- breaks hudson: disable till we get a chance to give it the time that
it needs - http://hudson.zones.apache.org/hudson/job/ActiveMQ/org.apache.activemq$activemq-core/199/testReport/org.apache.activemq.network/BrokerNetworkWithStuckMessagesTest/testBrokerNetworkWithStuckMessages/
-->
             <exclude>**/BrokerNetworkWithStuckMessagesTest.*</exclude>
             
-            <!-- until https://issues.apache.org/activemq/browse/AMQ-2448 is fixed -->
-            <exclude>**/VmTransportNetworkBrokerTest.*</exclude>
-            
           </excludes>
         </configuration>
       </plugin>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java?rev=932403&r1=932402&r2=932403&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
Fri Apr  9 13:31:36 2010
@@ -109,11 +109,15 @@ public class VMTransport implements Tran
             peer.enqueueValve.decrement();
         }
 
+        dispatch(peer, transportListener, command);
+    }
+    
+    public void dispatch(VMTransport transport, TransportListener transportListener, Object
command) {
         if( transportListener!=null ) {
             if( command == DISCONNECT ) {
                 transportListener.onException(new TransportDisposedIOException("Peer (" +
peer.toString() + ") disposed."));
             } else {
-                peer.receiveCounter++;
+                transport.receiveCounter++;
                 transportListener.onCommand(command);
             }
         }
@@ -129,7 +133,7 @@ public class VMTransport implements Tran
                 Object command;
                 while ((command = messageQueue.poll()) != null && !stopping.get()
) {
                     receiveCounter++;
-                    transportListener.onCommand(command);
+                    dispatch(this, transportListener, command);
                 }
             }
             started = true;
@@ -149,7 +153,14 @@ public class VMTransport implements Tran
         
         // If stop() is called while being start()ed.. then we can't stop until we return
to the start() method.
         if( enqueueValve.isOn() ) {
-
+        	
+            // let the peer know that we are disconnecting..
+            try {
+            	peer.transportListener.onException(new TransportDisposedIOException("Peer ("
+ peer.toString() + ") disposed."));
+            } catch (Exception ignore) {
+            }
+        	
+        	
             TaskRunner tr = null;
             try {
                 enqueueValve.turnOff();
@@ -168,12 +179,10 @@ public class VMTransport implements Tran
             if (tr != null) {
                 tr.shutdown(1000);
             }
-            // let the peer know that we are disconnecting..
-            try {
-                oneway(DISCONNECT);
-            } catch (Exception ignore) {
-            }
+            
+
         }
+        
     }
     
     /**

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java?rev=932403&r1=932402&r2=932403&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
Fri Apr  9 13:31:36 2010
@@ -206,16 +206,7 @@ public class VMTransportFactory extends 
 
     public static void stopped(VMTransportServer server) {
         String host = server.getBindURI().getHost();
-        SERVERS.remove(host);
-        TransportConnector connector = CONNECTORS.remove(host);
-        if (connector != null) {
-            LOG.debug("Shutting down VM connectors for broker: " + host);
-            ServiceSupport.dispose(connector);
-            BrokerService broker = BROKERS.remove(host);
-            if (broker != null) {
-                ServiceSupport.dispose(broker);
-            }
-        }
+        stopped(host);
     }
 
     public static void stopped(String host) {

Modified: activemq/trunk/assembly/src/release/conf/camel.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/conf/camel.xml?rev=932403&r1=932402&r2=932403&view=diff
==============================================================================
--- activemq/trunk/assembly/src/release/conf/camel.xml (original)
+++ activemq/trunk/assembly/src/release/conf/camel.xml Fri Apr  9 13:31:36 2010
@@ -60,6 +60,5 @@
             <property name="password" value="${activemq.password}"/>
           </bean>
         </property>
-        <property name="useSingleConnection" value="true" />
     </bean>
 </beans>

Modified: activemq/trunk/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml?rev=932403&r1=932402&r2=932403&view=diff
==============================================================================
--- activemq/trunk/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml (original)
+++ activemq/trunk/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml Fri Apr
 9 13:31:36 2010
@@ -58,6 +58,5 @@
             <property name="password" value="${activemq.password}"/>
           </bean>
         </property>
-        <property name="useSingleConnection" value="true" />
     </bean>
 </beans>



Mime
View raw message