in zuul-core/src/main/java/com/netflix/zuul/netty/server/OriginResponseReceiver.java [111:157]
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof CompleteEvent completeEvent) {
CompleteReason reason = completeEvent.getReason();
if ((reason != CompleteReason.SESSION_COMPLETE) && (edgeProxy != null)) {
if (reason == CompleteReason.CLOSE
&& Objects.equals(ctx.channel().attr(SSL_CLOSE_NOTIFY_SEEN).get(), Boolean.TRUE)) {
logger.warn(
"Origin request completed with close, after getting a SslCloseCompletionEvent event: {}",
ChannelUtils.channelInfoForLogging(ctx.channel()));
edgeProxy.errorFromOrigin(new OriginConnectException(
"Origin connection close_notify", OutboundErrorType.CLOSE_NOTIFY_CONNECTION));
} else {
logger.error(
"Origin request completed with reason other than COMPLETE: {}, {}",
reason.name(),
ChannelUtils.channelInfoForLogging(ctx.channel()));
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 SslHandshakeCompletionEvent && !((SslHandshakeCompletionEvent) evt).isSuccess()) {
Throwable cause = ((SslHandshakeCompletionEvent) evt).cause();
ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).set(cause);
} else if (evt instanceof IdleStateEvent) {
if (edgeProxy != null) {
logger.error(
"Origin request received IDLE event: {}", ChannelUtils.channelInfoForLogging(ctx.channel()));
edgeProxy.errorFromOrigin(
new OutboundException(OutboundErrorType.READ_TIMEOUT, edgeProxy.getRequestAttempts()));
}
super.userEventTriggered(ctx, evt);
} else if (evt instanceof SslCloseCompletionEvent) {
logger.debug("Received SslCloseCompletionEvent on {}", ChannelUtils.channelInfoForLogging(ctx.channel()));
ctx.channel().attr(SSL_CLOSE_NOTIFY_SEEN).set(true);
super.userEventTriggered(ctx, evt);
} else {
super.userEventTriggered(ctx, evt);
}
}