He-Pin commented on code in PR #1635:
URL: https://github.com/apache/pekko/pull/1635#discussion_r1898916610


##########
remote/src/main/scala/org/apache/pekko/remote/transport/netty/TcpSupport.scala:
##########
@@ -56,8 +58,16 @@ private[remote] trait TcpHandlers extends CommonHandlers {
   }
 
   override def onMessage(ctx: ChannelHandlerContext, msg: ByteBuf): Unit = {
-    val bytes: Array[Byte] = ByteBufUtil.getBytes(msg)
-    if (bytes.length > 0) notifyListener(ctx.channel(), 
InboundPayload(ByteString(bytes)))
+    try {
+      val bytes: Array[Byte] = ByteBufUtil.getBytes(msg)
+      if (bytes.length > 0) notifyListener(ctx.channel(), 
InboundPayload(ByteString(bytes)))
+    } catch {
+      case NonFatal(e) =>
+        log.warning("Error while handling message from [{}]: {}", 
ctx.channel().remoteAddress(), e)
+        onException(ctx, e)
+    } finally {
+      msg.release()

Review Comment:
   Sorry for not checking the `LengthFieldBasedFrameDecoder` in detail, we need 
to turn on the leak detector in nightly testing I think. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to