You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by yi...@apache.org on 2024/05/15 11:58:54 UTC
(hudi) 01/21: [HUDI-7688] Stop retry inflate if encounter InterruptedIOException (#11125)
This is an automated email from the ASF dual-hosted git repository.
yihua pushed a commit to branch branch-0.x
in repository https://gitbox.apache.org/repos/asf/hudi.git
commit 7c6ecbb9e4c9ec7bca6659d54af8dc9d6040562a
Author: Jing Zhang <be...@gmail.com>
AuthorDate: Fri May 3 10:12:23 2024 +0800
[HUDI-7688] Stop retry inflate if encounter InterruptedIOException (#11125)
---
.../java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java b/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
index a215a9f16a7..ad07be8de7f 100644
--- a/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
+++ b/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
@@ -37,6 +37,7 @@ import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
@@ -295,6 +296,10 @@ public abstract class HoodieLogBlock {
inputStream.seek(this.getBlockContentLocation().get().getContentPositionInLogFile());
inputStream.readFully(content.get(), 0, content.get().length);
inputStream.seek(this.getBlockContentLocation().get().getBlockEndPos());
+ } catch (InterruptedIOException e) {
+ // Stop retry inflate if encounters InterruptedIOException
+ Thread.currentThread().interrupt();
+ throw new HoodieIOException("Thread is interrupted while inflating.", e);
} catch (IOException e) {
// TODO : fs.open() and return inputstream again, need to pass FS configuration
// because the inputstream might close/timeout for large number of log blocks to be merged