-
Notifications
You must be signed in to change notification settings - Fork 145
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
[ISSUE-509] Fix Flaky Test: ShuffleBufferManagerTest#shuffleFlushThreshold #510
Conversation
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 the fix @xianjingfeng, some nits here.
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #510 +/- ##
============================================
+ Coverage 59.73% 59.78% +0.04%
- Complexity 1764 1770 +6
============================================
Files 205 205
Lines 11527 11531 +4
Branches 1033 1033
============================================
+ Hits 6886 6894 +8
+ Misses 4234 4232 -2
+ Partials 407 405 -2 ☔ View full report in Codecov by Sentry. |
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.
Could you help describe more about this fix in description? From current code, this fix looks a little bit strange.
Because the flush operation is asynchronous, the first block maybe been flushed when judging the memory size. |
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.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.
LGTM, thanks @xianjingfeng for the fix, and thanks @advancedxy for the review.
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 updating the PR @xianjingfeng. The motivation is good, but here is some concerns.
server/src/test/java/org/apache/uniffle/server/buffer/ShuffleBufferManagerTest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/uniffle/server/buffer/ShuffleBufferManagerTest.java
Outdated
Show resolved
Hide resolved
"serverId", mockShuffleServer, storageManager) { | ||
|
||
@Override | ||
protected void startEventProcesser() { |
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 don't think we should override startEventProcesser
?
The processEvents
could be override with your previous change to the ShuffleBufferManager
.
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.
In this UT, if we start EventProcesser, events will be flushed automatically.
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.
https://github.com/apache/incubator-uniffle/pull/510/files/a803bf816ff79e16834ab6f42258373b71e71f5e
If you apply this code to your test class method, the event flush could be controlled externally?
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.
https://github.com/apache/incubator-uniffle/pull/510/files/a803bf816ff79e16834ab6f42258373b71e71f5e If you apply this code to your test class method, the event flush could be controlled externally?
Not exactly. At least we can control when to begin flush.
server/src/test/java/org/apache/uniffle/server/buffer/ShuffleBufferManagerTest.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.
Here is some thoughts to further reduce the exposed methods.
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java
Outdated
Show resolved
Hide resolved
Thanks @xianjingfeng for updating the PR, @advancedxy what do you think? |
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
processEventThread.setName("ProcessEventThread"); | ||
processEventThread.setDaemon(true); | ||
processEventThread.start(); | ||
startEventProcessor(); |
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.
nit: let's move L85 before this line since these two lines are related.
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.
Done
Maybe it's better to not expose |
Thanks @xianjingfeng for your help. This code generally looks good to me with one minor comment. And I believe after introduce the flush method, some other tests may also be refactored to use the flush method instead of |
Done |
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
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.
There is a bug introduced in the last commit.
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.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.
LGTM, thanks a lot @xianjingfeng.
What changes were proposed in this pull request?
The reason is that the flush operation is asynchronous, the first block maybe been flushed when judging the memory size.
So the solution is to support active trigger flush.
Why are the changes needed?
Fix #509 Flaky Test: ShuffleBufferManagerTest#shuffleFlushThreshold.
Does this PR introduce any user-facing change?
No
How was this patch tested?
No need