-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix ByteBuf leak in remoting transport. #1635
Conversation
multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala
Outdated
Show resolved
Hide resolved
log.warning("Error while handling message from [{}]: {}", ctx.channel().remoteAddress(), e) | ||
onException(ctx, e) | ||
} finally { | ||
msg.release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't call release, because it's a retainedSlice
not a readRetainedSlice
, will dig it deeper
I would prefer if the exception handling changes were tracked separately - separate issue with a description of why the existing exception handling is wrong - and separate PR. I think this PR should just add the finally block with the buffer release. That is all that highlighted as wrong in the issue. |
OK, Will split |
Motivation:
refs: #1634
Modification:
Call
byteBuf.release
after bytes read.Result:
No leaks.
Sorry for everyone.
It's using
retainedSlice
inLengthFieldBasedFrameDecoder