activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [1/2] activemq git commit: Revert "AMQ-6494 Return ExceptionResponse during broker service shutdown" the root cause seems to be in the vm transport iterator
Date Tue, 04 Apr 2017 13:17:49 GMT
Repository: activemq
Updated Branches:
  refs/heads/master c1cbf509d -> 729766e49


Revert "AMQ-6494 Return ExceptionResponse during broker service shutdown"
the root cause seems to be in the vm transport iterator

This reverts commit dce2b61f870245a0c12b634d12cd0fa3a8a60daa.


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

Branch: refs/heads/master
Commit: 0f7561e85ab18912ce65120dde465aef5acda12a
Parents: c1cbf50
Author: gtully <gary.tully@gmail.com>
Authored: Tue Apr 4 14:15:00 2017 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Apr 4 14:15:00 2017 +0100

----------------------------------------------------------------------
 .../activemq/broker/TransportConnection.java      | 18 ++++++++++--------
 .../src/test/resources/handleReplyToActivemq.xml  |  1 -
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/0f7561e8/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 a444d27..b18881d 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -101,6 +101,7 @@ import org.apache.activemq.transport.TransportDisposedIOException;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.MarshallingSupport;
 import org.apache.activemq.util.NetworkBridgeUtils;
+import org.apache.activemq.util.SubscriptionKey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
@@ -189,9 +190,13 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
                         throw new RuntimeException("Protocol violation - Command corrupted:
" + o.toString());
                     }
                     Command command = (Command) o;
-                    Response response = service(command);
-                    if (response != null) {
-                        dispatchSync(response);
+                    if (!brokerService.isStopping()) {
+                        Response response = service(command);
+                        if (response != null && !brokerService.isStopping()) {
+                            dispatchSync(response);
+                        }
+                    } else {
+                        throw new BrokerStoppedException("Broker " + brokerService + " is
being stopped");
                     }
                 } finally {
                     serviceLock.readLock().unlock();
@@ -321,13 +326,10 @@ public class TransportConnection implements Connection, Task, CommandVisitor
{
         boolean responseRequired = command.isResponseRequired();
         int commandId = command.getCommandId();
         try {
-            if (brokerService.isStopping()) {
-                response = responseRequired ? new ExceptionResponse(
-                    new BrokerStoppedException("Broker " + brokerService + " is being stopped"))
: null;
-            } else if (!pendingStop.get()) {
+            if (!pendingStop.get()) {
                 response = command.visit(this);
             } else {
-                response = responseRequired ? new ExceptionResponse(transportException.get())
: null;
+                response = new ExceptionResponse(transportException.get());
             }
         } catch (Throwable e) {
             if (SERVICELOG.isDebugEnabled() && e.getClass() != BrokerStoppedException.class)
{

http://git-wip-us.apache.org/repos/asf/activemq/blob/0f7561e8/activemq-unit-tests/src/test/resources/handleReplyToActivemq.xml
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/resources/handleReplyToActivemq.xml b/activemq-unit-tests/src/test/resources/handleReplyToActivemq.xml
index 9a5df34..f85c9f2 100644
--- a/activemq-unit-tests/src/test/resources/handleReplyToActivemq.xml
+++ b/activemq-unit-tests/src/test/resources/handleReplyToActivemq.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <!--
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with


Mime
View raw message