diff --git a/fe/fe-core/src/main/java/com/starrocks/http/HttpServerHandler.java b/fe/fe-core/src/main/java/com/starrocks/http/HttpServerHandler.java index ebd5350c1a513..14331da405564 100644 --- a/fe/fe-core/src/main/java/com/starrocks/http/HttpServerHandler.java +++ b/fe/fe-core/src/main/java/com/starrocks/http/HttpServerHandler.java @@ -59,7 +59,11 @@ public void channelReadComplete(ChannelHandlerContext ctx) { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - if (msg instanceof HttpRequest) { + try { + if (!(msg instanceof HttpRequest)) { + return; + } + this.request = (HttpRequest) msg; if (LOG.isDebugEnabled()) { LOG.debug("request: url:[{}]", request.uri()); @@ -91,7 +95,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception req.getRequest().uri(), Thread.currentThread().getId(), startTime, latency); } } - } else { + } finally { ReferenceCountUtil.release(msg); } }