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


##########
remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyHelpers.scala:
##########
@@ -53,10 +53,19 @@ private[netty] trait NettyHelpers {
 /**
  * INTERNAL API
  */
-private[netty] abstract class NettyChannelHandlerAdapter extends 
SimpleChannelInboundHandler[ByteBuf]
+private[netty] abstract class NettyChannelHandlerAdapter extends 
ChannelInboundHandlerAdapter
     with NettyHelpers {
-  final override def channelRead0(ctx: ChannelHandlerContext, msg: ByteBuf): 
Unit = {
-    onMessage(ctx, msg)
+
+  final override def channelRead(ctx: ChannelHandlerContext, msg: AnyRef): 
Unit = {
+    msg match {
+      case buf: ByteBuf =>
+        try {
+          onMessage(ctx, buf)
+        } catch {
+          case ex: Throwable => transformException(ctx, ex)
+        } finally buf.release() // ByteBuf must be released explicitly

Review Comment:
   it was released by the `finally` block in `SimpleChannelInboundHandler`



-- 
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