summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-10-11 12:01:06 +0000
committerRobert Gemmell <robbie@apache.org>2011-10-11 12:01:06 +0000
commit355e17c342fc45932d3ed05bf0500f78f9e93be3 (patch)
tree8babba092b70042f3395bccd567939eab1bafb93
parent62899dd473d48f6fb3e93aa65bd9a43770460a70 (diff)
downloadqpid-python-355e17c342fc45932d3ed05bf0500f78f9e93be3.tar.gz
QPID-3534: ignore transport exceptions raised whilst closing the network connection after sending the close-ok reply, as these can prevent failover occurring and are actually related to the broker (incorrectly) having already closed the socket
Applied patch from Oleksandr Rudyy<orudyy@gmail.com> and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1181735 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
index a4694ce00f..b7253e6e9c 100644
--- a/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ b/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
@@ -47,6 +47,7 @@ import org.apache.qpid.framing.ProtocolVersion;
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
import org.apache.qpid.transport.Sender;
+import org.apache.qpid.transport.TransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -362,7 +363,15 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
public void closeProtocolSession() throws AMQException
{
- _protocolHandler.getNetworkConnection().close();
+ try
+ {
+ _protocolHandler.getNetworkConnection().close();
+ }
+ catch(TransportException e)
+ {
+ //ignore such exceptions, they were already logged
+ //and this is a forcible close.
+ }
}
public void failover(String host, int port)