diff options
author | Robert Gemmell <robbie@apache.org> | 2011-10-11 12:01:06 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-10-11 12:01:06 +0000 |
commit | 23e1fdd059527199c5e3f777d439ccf6591249c1 (patch) | |
tree | c1c24f2bb522bf2a35f18bdf9d0d8e63acdcc401 | |
parent | 7045465b166b911eda5f802511b967aa576b202f (diff) | |
download | qpid-python-23e1fdd059527199c5e3f777d439ccf6591249c1.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@1181735 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java index a4694ce00f..b7253e6e9c 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java +++ b/qpid/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) |