LOG.warn("Received complete event while still handling the request. With reason: " + reason.name() + " -- " + ChannelUtils.channelInfoForLogging(ctx.channel()));
zuulCtx.getUUID(), clientRequest.uri(), reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel()));
LOG.warn("Received complete event while still handling the request. With reason: " + reason.name() + ChannelUtils.channelInfoForLogging(ctx.channel()));
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { // First let other handlers do their thing ... // super.userEventTriggered(ctx, evt); if (evt instanceof IdleStateEvent) { // Log some info about this. idleCounter.increment(); final String msg = "Origin channel for origin - " + originName + " - idle timeout has fired. " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } else if (evt instanceof CompleteEvent) { // The HttpLifecycleChannelHandler instance will fire this event when either a response has finished being written, or // the channel is no longer active or disconnected. // Return the connection to pool. final CompleteReason reason = ((CompleteEvent) evt).getReason(); if (reason == SESSION_COMPLETE) { final PooledConnection conn = PooledConnection.getFromChannel(ctx.channel()); if (conn != null) { conn.setConnectionState(PooledConnection.ConnectionState.WRITE_READY); conn.release(); } } else { final String msg = "Origin channel for origin - " + originName + " - completed with reason " + reason.name() + ", " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof CompleteEvent) { final CompleteReason reason = ((CompleteEvent) evt).getReason(); if ((reason != SESSION_COMPLETE) && (edgeProxy != null)) { LOG.error("Origin request completed with reason other than COMPLETE: {}, {}", reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel())); final ZuulException ze = new ZuulException("CompleteEvent", reason.name(), true); edgeProxy.errorFromOrigin(ze); } // First let this event propagate along the pipeline, before cleaning vars from the channel. // See channelWrite() where these vars are first set onto the channel. try { super.userEventTriggered(ctx, evt); } finally { postCompleteHook(ctx, evt); } } else if (evt instanceof IdleStateEvent) { if (edgeProxy != null) { LOG.error("Origin request received IDLE event: {}", ChannelUtils.channelInfoForLogging(ctx.channel())); edgeProxy.errorFromOrigin(new OutboundException(READ_TIMEOUT, edgeProxy.getRequestAttempts())); } super.userEventTriggered(ctx, evt); } else { super.userEventTriggered(ctx, evt); } }
LOG.warn("Received complete event while still handling the request. With reason: " + reason.name() + " -- " + ChannelUtils.channelInfoForLogging(ctx.channel()));
zuulCtx.getUUID(), clientRequest.uri(), reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel()));
zuulCtx.getUUID(), clientRequest.uri(), reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel()));
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof CompleteEvent) { final CompleteReason reason = ((CompleteEvent) evt).getReason(); if ((reason != SESSION_COMPLETE) && (edgeProxy != null)) { LOG.error("Origin request completed with reason other than COMPLETE: {}, {}", reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel())); final ZuulException ze = new ZuulException("CompleteEvent", reason.name(), true); edgeProxy.errorFromOrigin(ze); } // First let this event propagate along the pipeline, before cleaning vars from the channel. // See channelWrite() where these vars are first set onto the channel. try { super.userEventTriggered(ctx, evt); } finally { postCompleteHook(ctx, evt); } } else if (evt instanceof IdleStateEvent) { if (edgeProxy != null) { LOG.error("Origin request received IDLE event: {}", ChannelUtils.channelInfoForLogging(ctx.channel())); edgeProxy.errorFromOrigin(new OutboundException(READ_TIMEOUT, edgeProxy.getRequestAttempts())); } super.userEventTriggered(ctx, evt); } else { super.userEventTriggered(ctx, evt); } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof CompleteEvent) { final CompleteReason reason = ((CompleteEvent) evt).getReason(); if ((reason != SESSION_COMPLETE) && (edgeProxy != null)) { LOG.error("Origin request completed with reason other than COMPLETE: {}, {}", reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel())); final ZuulException ze = new ZuulException("CompleteEvent", reason.name(), true); edgeProxy.errorFromOrigin(ze); } // First let this event propagate along the pipeline, before cleaning vars from the channel. // See channelWrite() where these vars are first set onto the channel. try { super.userEventTriggered(ctx, evt); } finally { postCompleteHook(ctx, evt); } } else if (evt instanceof IdleStateEvent) { if (edgeProxy != null) { LOG.error("Origin request received IDLE event: {}", ChannelUtils.channelInfoForLogging(ctx.channel())); edgeProxy.errorFromOrigin(new OutboundException(READ_TIMEOUT, edgeProxy.getRequestAttempts())); } super.userEventTriggered(ctx, evt); } else { super.userEventTriggered(ctx, evt); } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { // First let other handlers do their thing ... // super.userEventTriggered(ctx, evt); if (evt instanceof IdleStateEvent) { // Log some info about this. idleCounter.increment(); final String msg = "Origin channel for origin - " + originName + " - idle timeout has fired. " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } else if (evt instanceof CompleteEvent) { // The HttpLifecycleChannelHandler instance will fire this event when either a response has finished being written, or // the channel is no longer active or disconnected. // Return the connection to pool. final CompleteReason reason = ((CompleteEvent) evt).getReason(); if (reason == SESSION_COMPLETE) { final PooledConnection conn = PooledConnection.getFromChannel(ctx.channel()); if (conn != null) { conn.setConnectionState(PooledConnection.ConnectionState.WRITE_READY); conn.release(); } } else { final String msg = "Origin channel for origin - " + originName + " - completed with reason " + reason.name() + ", " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { // First let other handlers do their thing ... // super.userEventTriggered(ctx, evt); if (evt instanceof IdleStateEvent) { // Log some info about this. idleCounter.increment(); final String msg = "Origin channel for origin - " + originName + " - idle timeout has fired. " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } else if (evt instanceof CompleteEvent) { // The HttpLifecycleChannelHandler instance will fire this event when either a response has finished being written, or // the channel is no longer active or disconnected. // Return the connection to pool. final CompleteReason reason = ((CompleteEvent) evt).getReason(); if (reason == SESSION_COMPLETE) { final PooledConnection conn = PooledConnection.getFromChannel(ctx.channel()); if (conn != null) { conn.setConnectionState(PooledConnection.ConnectionState.WRITE_READY); conn.release(); } } else { final String msg = "Origin channel for origin - " + originName + " - completed with reason " + reason.name() + ", " + ChannelUtils.channelInfoForLogging(ctx.channel()); closeConnection(ctx, msg); } } }