From d8cd37030ba51a14623abc4fbe168454b36c2970 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Wed, 22 Jan 2014 17:48:11 -0500 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-4989 --- .../activemq/transport/tcp/TcpTransportServer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 5e1426a9d5..6eab645243 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 @@ -374,7 +374,16 @@ public class TcpTransportServer extends TransportServerThreadSupport implements while (!isStopped() && !isStopping()) { Socket sock = socketQueue.poll(1, TimeUnit.SECONDS); if (sock != null) { - handleSocket(sock); + try { + handleSocket(sock); + } catch (Throwable thrown) { + if (!isStopping()) { + onAcceptError(new Exception(thrown)); + } else if (!isStopped()) { + LOG.warn("Unexpected error thrown during accept handling: ", thrown); + onAcceptError(new Exception(thrown)); + } + } } } @@ -519,6 +528,7 @@ public class TcpTransportServer extends TransportServerThreadSupport implements return allowLinkStealing; } + @Override public void setAllowLinkStealing(boolean allowLinkStealing) { this.allowLinkStealing = allowLinkStealing; }