-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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][ml] Fix memory leak due to duplicated RangeCache value retain operations #23955
[fix][ml] Fix memory leak due to duplicated RangeCache value retain operations #23955
Conversation
Though I think catching the |
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.
Thanks for finding the problem area. However, this isn't currently the correct fix to the problem. Explained in #23955 (comment) . There's also comments in the original code on line 389 and 430 where the extra reference is removed.
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.
Oh sorry, reviewed again and noticed that it's fine.
The |
This is necessary in this case due to the racy usage of the cache without synchronization. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23955 +/- ##
============================================
+ Coverage 73.57% 74.23% +0.66%
+ Complexity 32624 31919 -705
============================================
Files 1877 1853 -24
Lines 139502 143828 +4326
Branches 15299 16344 +1045
============================================
+ Hits 102638 106773 +4135
+ Misses 28908 28674 -234
- Partials 7956 8381 +425
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I'll merge this as soon as it completes, since I'm creating a PR to prevent future regressions by enabling Netty Leak detector in Pulsar CI so that any detected leak will make the build fail. |
I have created #23956 (WIP, draft) to address future memory leak regressions. It seems that there are quite a few tests where leaks happen currently and some of them are hard to fix. I have added a solution where it's possible to ignore specific test classes. |
…perations (apache#23955) Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 20b3b22)
…perations (apache#23955) Co-authored-by: Lari Hotari <lhotari@apache.org>
…perations (apache#23955) Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 20b3b22) (cherry picked from commit 224320e)
…perations (apache#23955) Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 20b3b22) (cherry picked from commit dafd347)
…perations (apache#23955) Co-authored-by: Lari Hotari <lhotari@apache.org> (cherry picked from commit 20b3b22) (cherry picked from commit 224320e)
Motivation
#23903 introduces a memory leak issue in
RangeCache#removeEntry
.Unlike
entryWrapper.getValue
,getValueMatchingEntry
will increase the reference count ofentry
's value.Modifications
RangeCache#removeEntry
. Add some API notes for the private methods that might increase the reference count of the valueRangeCache
(RangeCacheTest.customTimeExtraction
).Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: