Skip to content
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

Fast fail when reading failed in ComposedClientReadHandler #213

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

zuston
Copy link
Member

@zuston zuston commented Sep 13, 2022

What changes were proposed in this pull request?

Fast fail when reading failed in ComposedClientReadHandler

Why are the changes needed?

It should fast fail on network failure when reading shuffle data from memory/localfile/hdfs in ComposedClientReadHandler. If not, it will throw inconsistent blockIds and make users confused.

Does this PR introduce any user-facing change?

No

How was this patch tested?

UTs.

@zuston
Copy link
Member Author

zuston commented Sep 14, 2022

Ping @frankliee Could help review this PR? If OK, I think I will go ahead.

@jerqi
Copy link
Contributor

jerqi commented Sep 14, 2022

Like discussion at dev mail list, we will freeze the code and cut 0.6 version branch in September 15, we will not merge this pr before I cut 0.6 version branch, are you ok?

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2022

Codecov Report

Merging #213 (4b112e2) into master (9ef48d6) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 4b112e2 differs from pull request most recent head 09bb8f6. Consider uploading reports for the commit 09bb8f6 to get more accurate results

@@             Coverage Diff              @@
##             master     #213      +/-   ##
============================================
- Coverage     59.10%   59.07%   -0.03%     
- Complexity     1326     1327       +1     
============================================
  Files           160      161       +1     
  Lines          8727     8736       +9     
  Branches        817      817              
============================================
+ Hits           5158     5161       +3     
- Misses         3303     3310       +7     
+ Partials        266      265       -1     
Impacted Files Coverage Δ
...niffle/common/exception/FileNotFoundException.java 0.00% <0.00%> (ø)
...pache/uniffle/server/ShuffleServerGrpcService.java 0.90% <0.00%> (-0.02%) ⬇️
...torage/handler/impl/ComposedClientReadHandler.java 0.00% <0.00%> (ø)
...orage/handler/impl/LocalFileServerReadHandler.java 77.96% <0.00%> (ø)
...org/apache/uniffle/server/ShuffleFlushManager.java 78.33% <0.00%> (+1.66%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -80,7 +81,7 @@ private void prepareFilePath(
File baseFolder = new File(fullShufflePath);
if (!baseFolder.exists()) {
// the partition doesn't exist in this base folder, skip
throw new RuntimeException("Can't find folder " + fullShufflePath);
throw new FileNotFoundException("Can't find folder " + fullShufflePath);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change exception to FileNotFoundException ,this should not be thrown to client.

For example:
When using the MEMORY_LOCALFILE_HDFS type, sometime, the localfile storage may be empty due to the big event flushed to HDFS directly. So when I want to fast fail in ComposedClientReadHandler, this problem should be involved. So this exception should be handled in server's grpc api and return the empty index result.

@zuston
Copy link
Member Author

zuston commented Sep 16, 2022

Ping @frankliee

@zuston
Copy link
Member Author

zuston commented Sep 20, 2022

PTAL @frankliee


package org.apache.uniffle.common.exception;

public class FileNotFoundException extends RuntimeException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use Java.io.FileNotFoundException?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java.io.FileNotFoundException is IOException which need to catch in invoking side, so introduce this extending the RuntimeException.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do u think @frankliee

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @zuston @frankliee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants