Skip to content

Commit ec17fc4

Browse files
TengHuosatishkotha
authored andcommitted
[HUDI-4880] Fix corrupted parquet file issue left over by cancelled compaction task (apache#6733)
1 parent df5ae63 commit ec17fc4

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/clustering/ClusteringOperator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ public void processElement(StreamRecord<ClusteringPlanEvent> element) throws Exc
180180
}
181181

182182
@Override
183-
public void close() {
183+
public void close() throws Exception {
184+
if (null != this.executor) {
185+
this.executor.close();
186+
}
184187
if (this.writeClient != null) {
185188
this.writeClient.cleanHandlesGracefully();
186189
this.writeClient.close();

hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactFunction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,16 @@ private HoodieWriteConfig reloadWriteConfig() throws Exception {
130130
public void setExecutor(NonThrownExecutor executor) {
131131
this.executor = executor;
132132
}
133+
134+
@Override
135+
public void close() throws Exception {
136+
if (null != this.executor) {
137+
this.executor.close();
138+
}
139+
if (null != this.writeClient) {
140+
this.writeClient.cleanHandlesGracefully();
141+
this.writeClient.close();
142+
this.writeClient = null;
143+
}
144+
}
133145
}

0 commit comments

Comments
 (0)