activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [2/2] activemq git commit: [AMQ-6494] ensure vm transport propagates onCommand exceptions to peer
Date Tue, 04 Apr 2017 13:17:50 GMT
[AMQ-6494] ensure vm transport propagates onCommand exceptions to peer


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

Branch: refs/heads/master
Commit: 729766e4925ec05ec05410887df146dd27adbbf4
Parents: 0f7561e
Author: gtully <gary.tully@gmail.com>
Authored: Tue Apr 4 14:17:27 2017 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Apr 4 14:17:27 2017 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/transport/vm/VMTransport.java     | 10 +++++++++-
 .../org/apache/activemq/bugs/embedded/ThreadExplorer.java |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/729766e4/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 5f75a3c..9ef7860 100644
--- 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
@@ -35,6 +35,7 @@ import org.apache.activemq.transport.ResponseCallback;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportDisposedIOException;
 import org.apache.activemq.transport.TransportListener;
+import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.wireformat.WireFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -270,7 +271,14 @@ public class VMTransport implements Transport, Task {
 
         Object command = mq.poll();
         if (command != null && !disposed.get()) {
-            tl.onCommand(command);
+            try {
+                tl.onCommand(command);
+            } catch (Exception e) {
+                try {
+                    peer.transportListener.onException(IOExceptionSupport.create(e));
+                } catch (Exception ignore) {
+                }
+            }
             return !mq.isEmpty() && !disposed.get();
         } else {
             if(disposed.get()) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/729766e4/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/embedded/ThreadExplorer.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/embedded/ThreadExplorer.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/embedded/ThreadExplorer.java
index eab5fd1..1d6e204 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/embedded/ThreadExplorer.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/embedded/ThreadExplorer.java
@@ -137,7 +137,7 @@ public class ThreadExplorer
             if (thread != null)
             {
                 out.append("* [" + thread.getName() + "] " + (thread.isDaemon() ? "(Daemon)"
: "")
-                        + " Group: " + thread.getThreadGroup().getName() + "\n");
+                        + " Group: " + (thread.getThreadGroup() != null ? thread.getThreadGroup().getName()
: "") + "\n");
             }
             else
             {


Mime
View raw message