From 782643ce33efceaa14db7dedce863d65eea2d9b8 Mon Sep 17 00:00:00 2001 From: jianglai Date: Thu, 16 Aug 2018 08:05:30 -0700 Subject: [PATCH] Log all exceptions thrown at the end of the pipeline The RelayHandler is installed at the end of a channel pipeline (both frontend and backend). If it does not log the exception, it will be regarded and unhandled exception, which shows up in logs, but does not log the corresponding channel. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=208984756 --- java/google/registry/proxy/handler/RelayHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/google/registry/proxy/handler/RelayHandler.java b/java/google/registry/proxy/handler/RelayHandler.java index f76c8f616..3da0740c7 100644 --- a/java/google/registry/proxy/handler/RelayHandler.java +++ b/java/google/registry/proxy/handler/RelayHandler.java @@ -78,10 +78,11 @@ public class RelayHandler extends SimpleChannelInboundHandler { if (cause instanceof OverQuotaException) { logger.atWarning().withCause(cause).log( "Channel %s closed due to quota exceeded.", ctx.channel()); - ChannelFuture unusedFuture = ctx.close(); } else { - ctx.fireExceptionCaught(cause); + logger.atWarning().withCause(cause).log( + "Channel %s closed due to unexpected exception.", ctx.channel()); } + ChannelFuture unusedFuture = ctx.close(); } public static void writeToRelayChannel(