yihua commented on code in PR #11445:
URL: https://github.com/apache/hudi/pull/11445#discussion_r1751120647
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/hadoop/fs/HoodieRetryWrapperFileSystem.java:
##########
@@ -185,12 +186,20 @@ public boolean rename(Path src, Path dst) throws
IOException {
@Override
public boolean delete(Path f, boolean recursive) throws IOException {
return new RetryHelper<Boolean, IOException>(maxRetryIntervalMs,
maxRetryNumbers, initialRetryIntervalMs, retryExceptionsList)
- .tryWith(() -> fileSystem.delete(f, recursive)).start().booleanValue();
+ .tryWith(() -> {
+ boolean success = fileSystem.delete(f, recursive);
+ if (!success) {
+ if (fileSystem.exists(f)) {
+ throw new HoodieIOException("Failed to delete file: " + f);
+ }
+ }
+ return success;
+ }).start().booleanValue();
}
@Override
public boolean delete(Path f) throws IOException {
- return new RetryHelper<Boolean, IOException>(maxRetryIntervalMs,
maxRetryNumbers, initialRetryIntervalMs, retryExceptionsList).tryWith(() ->
fileSystem.delete(f, true)).start().booleanValue();
+ return delete(f, true);
Review Comment:
Any other places in the repo that may not use `delete` APIs in these two
classes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]