Fixed a problem where HttpTunnelingChannelHandler does not log caught exceptions
This commit is contained in:
parent
55ed37d82c
commit
5a18c91435
@ -40,6 +40,8 @@ import org.jboss.netty.channel.ChannelStateEvent;
|
|||||||
import org.jboss.netty.channel.ExceptionEvent;
|
import org.jboss.netty.channel.ExceptionEvent;
|
||||||
import org.jboss.netty.channel.MessageEvent;
|
import org.jboss.netty.channel.MessageEvent;
|
||||||
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
|
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
|
||||||
|
import org.jboss.netty.logging.InternalLogger;
|
||||||
|
import org.jboss.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A channel handler that proxies messages to the servlet output stream
|
* A channel handler that proxies messages to the servlet output stream
|
||||||
@ -50,6 +52,9 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
|
|||||||
*/
|
*/
|
||||||
@ChannelPipelineCoverage("one")
|
@ChannelPipelineCoverage("one")
|
||||||
class HttpTunnelingChannelHandler extends SimpleChannelUpstreamHandler {
|
class HttpTunnelingChannelHandler extends SimpleChannelUpstreamHandler {
|
||||||
|
|
||||||
|
private static final InternalLogger logger = InternalLoggerFactory.getInstance(HttpTunnelingChannelHandler.class);
|
||||||
|
|
||||||
List<MessageEvent> awaitingEvents = new ArrayList<MessageEvent>();
|
List<MessageEvent> awaitingEvents = new ArrayList<MessageEvent>();
|
||||||
|
|
||||||
private final Lock reconnectLock = new ReentrantLock();
|
private final Lock reconnectLock = new ReentrantLock();
|
||||||
@ -129,6 +134,7 @@ class HttpTunnelingChannelHandler extends SimpleChannelUpstreamHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
|
||||||
|
logger.warn("Unexpected exception", e.getCause());
|
||||||
if (invalidated.compareAndSet(false, true)) {
|
if (invalidated.compareAndSet(false, true)) {
|
||||||
session.invalidate();
|
session.invalidate();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user