Skip to content

Commit fbee40f

Browse files
authored
[netty] Avoid too many logs in NettyServerHandler if load balancer is mounted (#450)
1 parent 7833411 commit fbee40f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

fluss-rpc/src/main/java/com/alibaba/fluss/rpc/netty/server/NettyServerHandler.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,15 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
124124

125125
@Override
126126
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
127-
LOG.warn(
128-
"Connection [{}] got exception in Netty server pipeline: \n{}",
129-
ctx.channel().remoteAddress(),
130-
ExceptionUtils.stringifyException(cause));
127+
// debug level to avoid too many logs if NLB(Network Load Balancer is mounted, see
128+
// more detail in #377
129+
// may revert to warn level if we found warn level is necessary
130+
if (LOG.isDebugEnabled()) {
131+
LOG.debug(
132+
"Connection [{}] got exception in Netty server pipeline: \n{}",
133+
ctx.channel().remoteAddress(),
134+
ExceptionUtils.stringifyException(cause));
135+
}
131136
ByteBuf byteBuf = encodeServerFailure(ctx.alloc(), ApiError.fromThrowable(cause));
132137
ctx.writeAndFlush(byteBuf).addListener(ChannelFutureListener.CLOSE);
133138
}

0 commit comments

Comments
 (0)