-
Notifications
You must be signed in to change notification settings - Fork 149
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
[#1462] fix(server): Memory may leak when flushQueue is full #1463
[#1462] fix(server): Memory may leak when flushQueue is full #1463
Conversation
Yes. This PR could be involved in #1461 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1463 +/- ##
============================================
+ Coverage 54.21% 54.98% +0.76%
+ Complexity 2780 2776 -4
============================================
Files 426 407 -19
Lines 24237 21963 -2274
Branches 2063 2072 +9
============================================
- Hits 13141 12077 -1064
+ Misses 10280 9140 -1140
+ Partials 816 746 -70 ☔ View full report in Codecov by Sentry. |
I'm ok. I just hope your PR can be merged a bit faster, as I need these patches for testing. :) |
This fixes the corner case, I don't think It will leak resource on prod. |
Yes, you are right. 90% of the time it may be a normal scenario without memory leaks, but in the remaining 10% of cases, leaks may still occur. If the 10% scenario is triggered like crazy, it can still lead to serious memory leaks. I have encountered situations with crazy dropping events in our environment. |
a4e3358
to
f50a1b6
Compare
@@ -69,6 +69,8 @@ public DefaultFlushEventHandler( | |||
public void handle(ShuffleDataFlushEvent event) { | |||
if (!flushQueue.offer(event)) { | |||
LOG.error("Flush queue is full, discard event: " + event); | |||
// We need to release the memory when discarding the event |
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.
Please add the metric like ShuffleServerMetrics.counterTotalDroppedEventNum.inc();
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.
Fixed.
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. Thanks @rickyma
…pache#1463) ### What changes were proposed in this pull request? Release the memory when a flush event is dropped. ### Why are the changes needed? For [apache#1462](apache#1462) ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing UTs.
What changes were proposed in this pull request?
Release the memory when a flush event is dropped.
Why are the changes needed?
For #1462
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UTs.