-
Notifications
You must be signed in to change notification settings - Fork 892
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 ByteBuf memory leak problem when setExplicitLac #3577
Fix ByteBuf memory leak problem when setExplicitLac #3577
Conversation
ping @dlg99 @eolivelli @hangc0276 @zymap PTAL. Thanks. |
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.
@wenbingshen Would you please add a test to cover it?
@hangc0276 Okay. I will add a test later. Thanks. |
@hangc0276 I have added an unit test. PTAL. Thanks. When I roll back the changes from this PR, the test fails: The effect is as expected. |
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.
Great work
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.
Nice work!
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
Outdated
Show resolved
Hide resolved
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 think we can update the other old code to replace entry.release()
to ReferenceCountUtil.safeRelease(entry)
or else I pick up a new pr to do this ? have a look this @hangc0276 @eolivelli @dlg99 @shoothzj
@StevenLuMT I think we could use another PR to resolve that. |
I agree. |
@StevenLuMT PTAL. Thanks. |
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.
LGTM
* fix set explicitLac no released entry (cherry picked from commit faaf041)
@wenbingshen It's hard to cherry-pick this pr to branch-4.14, would you please push a separate Pr to branch-4.14? thanks |
@hangc0276 Okay. I will push a pr to 4.14 today. |
* fix set explicitLac no released entry
Motivation
org.apache.bookkeeper.bookie.BookieImpl#setExplicitLac did not release the reference to the entry at the end.