Skip to content

Commit 2afb839

Browse files
authored
[hotfix] Not throw exception when fail to list splits for streaming read partitioned table (apache#996)
1 parent 7751cfd commit 2afb839

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

fluss-flink/fluss-flink-common/src/main/java/com/alibaba/fluss/flink/source/enumerator/FlinkSourceEnumerator.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,16 @@ private void handlePartitionsRemoved(Collection<Partition> removedPartitionInfo)
524524

525525
private void handleSplitsAdd(List<SourceSplitBase> splits, Throwable t) {
526526
if (t != null) {
527-
throw new FlinkRuntimeException(
528-
String.format("Failed to list splits for %s to read due to ", tablePath), t);
527+
if (isPartitioned && streaming && scanPartitionDiscoveryIntervalMs > 0) {
528+
// it means continuously read new partition splits, not throw exception, temporally
529+
// warn it to avoid job fail. TODO: fix me in #288
530+
LOG.warn("Failed to list splits for {}.", tablePath, t);
531+
return;
532+
} else {
533+
throw new FlinkRuntimeException(
534+
String.format("Failed to list splits for %s to read due to ", tablePath),
535+
t);
536+
}
529537
}
530538
if (isPartitioned) {
531539
if (!streaming || scanPartitionDiscoveryIntervalMs <= 0) {

0 commit comments

Comments
 (0)