activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [2/3] activemq git commit: AMQ4221Test - remove system exit as it breaks surefire fork, https://issues.apache.org/jira/browse/AMQ-6004 interrupt causes errors on shutdown. Two are sorted but the check for errors in the logs may still cause intermittent f
Date Wed, 18 Nov 2015 16:21:36 GMT
AMQ4221Test - remove system exit as it breaks surefire fork, https://issues.apache.org/jira/browse/AMQ-6004
interrupt causes errors on shutdown. Two are sorted but the check for errors in the logs may
still cause intermittent failures


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

Branch: refs/heads/master
Commit: 15412bae64bf265687b1099e19cba008bac9c825
Parents: d7a3b94
Author: gtully <gary.tully@gmail.com>
Authored: Wed Nov 18 11:50:27 2015 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Wed Nov 18 16:08:29 2015 +0000

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/region/Queue.java   |  2 ++
 .../activemq/transport/tcp/TcpTransportServer.java      |  4 ++--
 .../test/java/org/apache/activemq/bugs/AMQ4221Test.java | 12 ++++++------
 3 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/15412bae/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index 107b1ac..e6c20de 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -47,6 +47,7 @@ import javax.jms.JMSException;
 import javax.jms.ResourceAllocationException;
 
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.BrokerStoppedException;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.ProducerBrokerExchange;
 import org.apache.activemq.broker.region.cursors.OrderedPendingList;
@@ -1132,6 +1133,7 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
 
             // we need a store iterator to walk messages on disk, independent of the cursor
which is tracking
             // the next message batch
+        } catch (BrokerStoppedException ignored) {
         } catch (Exception e) {
             LOG.error("Problem retrieving message for browse", e);
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/15412bae/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
index 8431903..43e6ae0 100755
--- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
@@ -441,8 +441,8 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
                         }
 
                     } catch (InterruptedException e) {
-                        LOG.info("socketQueue interuppted - stopping");
-                        if (!isStopping()) {
+                        if (!isStopped() || !isStopping()) {
+                            LOG.info("socketQueue interrupted - stopping");
                             onAcceptError(e);
                         }
                     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/15412bae/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4221Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4221Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4221Test.java
index 55e8027..0684cb6 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4221Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4221Test.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.bugs;
 
 import java.util.HashSet;
+import java.util.LinkedList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -74,6 +75,7 @@ public class AMQ4221Test extends TestSupport {
     private String brokerUrlString;
     ExecutorService executorService = Executors.newCachedThreadPool();
     final AtomicBoolean done = new AtomicBoolean(false);
+    final LinkedList<String> errorsInLog = new LinkedList<String>();
 
     public static Test suite() {
         return suite(AMQ4221Test.class);
@@ -87,18 +89,15 @@ public class AMQ4221Test extends TestSupport {
             @Override
             public void doAppend(LoggingEvent event) {
                 if (event.getLevel().isGreaterOrEqual(Level.ERROR)) {
-                    System.err.println("exit on error: " + event.getMessage());
+                    System.err.println("Fail on error in log: " + event.getMessage());
                     done.set(true);
-                    new Thread() {
-                        public void run() {
-                            System.exit(787);
-                        }
-                    }.start();
+                    errorsInLog.add(event.getRenderedMessage());
                 }
             }
         });
 
         done.set(false);
+        errorsInLog.clear();
         brokerService = new BrokerService();
         brokerService.setDeleteAllMessagesOnStartup(true);
         brokerService.setDestinations(new ActiveMQDestination[]{new ActiveMQQueue("ActiveMQ.DLQ")});
@@ -186,6 +185,7 @@ public class AMQ4221Test extends TestSupport {
         executorService.awaitTermination(5, TimeUnit.MINUTES);
 
         assertTrue("no exceptions:" + exceptions, exceptions.isEmpty());
+        assertTrue("No ERROR in log:" + errorsInLog, errorsInLog.isEmpty());
 
     }
 


Mime
View raw message