activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [2/4] activemq git commit: rework https://issues.apache.org/jira/browse/AMQ-3684 and https://issues.apache.org/jira/browse/AMQ-4532 to avoid intermittent hangs, processing shutdown wile shutdown is in progress - AMQ1936Test and AMQ2021Test - using just
Date Wed, 11 Feb 2015 15:27:40 GMT
rework  https://issues.apache.org/jira/browse/AMQ-3684 and https://issues.apache.org/jira/browse/AMQ-4532
to avoid intermittent hangs, processing shutdown wile shutdown is in progress - AMQ1936Test
and AMQ2021Test - using just TransportDisposedIOException to propagate exception response
and start shutdown process and ignoring broker side for logging


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/8cf98a07
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/8cf98a07
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/8cf98a07

Branch: refs/heads/master
Commit: 8cf98a070f0fb60857e85cb74c4969d0256ebb0e
Parents: c6837ac
Author: gtully <gary.tully@gmail.com>
Authored: Wed Feb 11 13:13:06 2015 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Wed Feb 11 13:37:32 2015 +0000

----------------------------------------------------------------------
 .../activemq/broker/TransportConnection.java    | 10 ++++----
 .../activemq/transport/vm/VMTransport.java      | 10 +-------
 .../java/org/apache/activemq/TestSupport.java   |  2 +-
 .../org/apache/activemq/bugs/AMQ2902Test.java   |  2 +-
 .../transport/vm/VMTransportThreadSafeTest.java | 25 --------------------
 5 files changed, 9 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/8cf98a07/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
index 270ed9f..5da0cfa 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -239,10 +239,12 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
         }
         if (!stopping.get() && !pendingStop) {
             transportException.set(e);
-            if (TRANSPORTLOG.isDebugEnabled()) {
-                TRANSPORTLOG.debug(this + " failed: " + e, e);
-            } else if (TRANSPORTLOG.isWarnEnabled() && !expected(e)) {
-                TRANSPORTLOG.warn(this + " failed: " + e);
+            if (! (e instanceof TransportDisposedIOException)) {
+                if (TRANSPORTLOG.isDebugEnabled()) {
+                    TRANSPORTLOG.debug(this + " failed: " + e, e);
+                } else if (TRANSPORTLOG.isWarnEnabled() && !expected(e)) {
+                    TRANSPORTLOG.warn(this + " failed: " + e);
+                }
             }
             stopAsync();
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/8cf98a07/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
b/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
index 75bd6fe..7b4e1a9 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
@@ -194,15 +194,7 @@ public class VMTransport implements Transport, Task {
             }
 
             if (peer.transportListener != null) {
-                // let the peer know that we are disconnecting after attempting
-                // to cleanly shutdown the async tasks so that this is the last
-                // command it see's.
-                try {
-                    peer.transportListener.onCommand(new ShutdownInfo());
-                } catch (Exception ignore) {
-                }
-
-                // let any requests pending a response see an exception
+                // let any requests pending a response see an exception and shutdown
                 try {
                     peer.transportListener.onException(new TransportDisposedIOException("peer
(" + this + ") stopped."));
                 } catch (Exception ignore) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/8cf98a07/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java b/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java
index 26af596..7ebe11c 100755
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java
@@ -173,7 +173,7 @@ public abstract class TestSupport extends CombinationTestSupport {
                         regionBroker.getTopicRegion().getDestinationMap();
     }
 
-    public static enum PersistenceAdapterChoice {LevelDB, KahaDB, AMQ, JDBC, MEM };
+    public static enum PersistenceAdapterChoice {LevelDB, KahaDB, JDBC, MEM };
 
     public PersistenceAdapter setDefaultPersistenceAdapter(BrokerService broker) throws IOException
{
         return setPersistenceAdapter(broker, defaultPersistenceAdapter);

http://git-wip-us.apache.org/repos/asf/activemq/blob/8cf98a07/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2902Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2902Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2902Test.java
index 3c38186..39e0407 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2902Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2902Test.java
@@ -75,7 +75,7 @@ public class AMQ2902Test extends TestCase {
 
     public void testNoExceptionOnClose() throws JMSException {
         ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
-                "vm://localhost?broker.persistent=false");
+                "vm://localhostTwo?broker.persistent=false");
         Connection connection = connectionFactory.createConnection();
         connection.close();
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/8cf98a07/activemq-unit-tests/src/test/java/org/apache/activemq/transport/vm/VMTransportThreadSafeTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/vm/VMTransportThreadSafeTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/vm/VMTransportThreadSafeTest.java
index 8534f89..ea3d833 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/vm/VMTransportThreadSafeTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/vm/VMTransportThreadSafeTest.java
@@ -263,31 +263,6 @@ public class VMTransportThreadSafeTest {
     }
 
     @Test(timeout=60000)
-    public void testStopSendsShutdownToPeer() throws Exception {
-
-        final VMTransport local = new VMTransport(new URI(location1));
-        final VMTransport remote = new VMTransport(new URI(location2));
-
-        local.setPeer(remote);
-        remote.setPeer(local);
-
-        final VMTestTransportListener remoteListener = new VMTestTransportListener(remoteReceived);
-
-        local.setTransportListener(new VMTestTransportListener(localReceived));
-        remote.setTransportListener(remoteListener);
-
-        local.start();
-        local.stop();
-
-        assertTrue(Wait.waitFor(new Wait.Condition() {
-            @Override
-            public boolean isSatisified() throws Exception {
-                return remoteListener.shutdownReceived;
-            }
-        }));
-    }
-
-    @Test(timeout=60000)
     public void testRemoteStopSendsExceptionToPendingRequests() throws Exception {
 
         final VMTransport local = new VMTransport(new URI(location1));


Mime
View raw message