From 355e17c342fc45932d3ed05bf0500f78f9e93be3 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Tue, 11 Oct 2011 12:01:06 +0000 Subject: 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 and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1181735 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/protocol/AMQProtocolSession.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'java') 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) -- cgit v1.2.1