Author: kwall
Date: Fri Feb 19 09:23:45 2016
New Revision: 1731210
URL: http://svn.apache.org/viewvc?rev=1731210&view=rev
Log:
QPID-7001: [Java Broker] Guard ClosedSelectorException to deal with the case
where the Port is shutdown before the the connection has finally closed
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java?rev=1731210&r1=1731209&r2=1731210&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/SelectorThread.java
Fri Feb 19 09:23:45 2016
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.net.SocketAddress;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedChannelException;
+import java.nio.channels.ClosedSelectorException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
@@ -591,10 +592,15 @@ class SelectorThread extends Thread
}
catch (ClosedChannelException e)
{
- LOGGER.debug("Failed to unregister with selector for connection "
+ connection +
- ". Connection is probably being closed by peer.", e);
+ LOGGER.debug("Failed to unregister with selector for connection
{}. " +
+ "Connection is probably being closed by peer.",
connection, e);
}
+ catch (ClosedSelectorException e)
+ {
+ LOGGER.debug("Failed to unregister with selector for connection
{}. " +
+ "Port has probably already been closed.", connection,
e);
+ }
}
public void close()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]