diff --git a/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/profile/WriteProfiles.java b/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/profile/WriteProfiles.java index 20bc46d67..d62b2086a 100644 --- a/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/profile/WriteProfiles.java +++ b/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/profile/WriteProfiles.java @@ -150,14 +150,17 @@ public class WriteProfiles { Path basePath, HoodieInstant instant, HoodieTimeline timeline) { - byte[] data = timeline.getInstantDetails(instant).get(); try { + byte[] data = timeline.getInstantDetails(instant).get(); return Option.of(HoodieCommitMetadata.fromBytes(data, HoodieCommitMetadata.class)); - } catch (IOException e) { + } catch (FileNotFoundException fe) { // make this fail safe. + LOG.warn("Instant {} was deleted by the cleaner, ignore", instant.getTimestamp()); + return Option.empty(); + } catch (IOException e) { LOG.error("Get write metadata for table {} with instant {} and path: {} error", tableName, instant.getTimestamp(), basePath); - return Option.empty(); + throw new HoodieException(e); } }