Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix][Connector-V2] Fix some throwable error not be caught #7657

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void submitTask(FetchTask<SourceSplitBase> fetchTask) {
currentSnapshotSplit,
taskContext.isExactlyOnce());
snapshotSplitReadTask.execute(taskContext);
} catch (Exception e) {
} catch (Throwable e) {
log.error(
String.format(
"Execute snapshot read task for snapshot split %s fail",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void submitTask(FetchTask<SourceSplitBase> fetchTask) {
currentIncrementalSplit,
taskContext.isExactlyOnce());
streamFetchTask.execute(taskContext);
} catch (Exception e) {
} catch (Throwable e) {
log.error(
String.format(
"Execute stream read task for incremental split %s fail",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
Thread.sleep(THREAD_WAIT_TIME);
return;
}
while (pendingPartitionsQueue.size() != 0) {
while (!pendingPartitionsQueue.isEmpty()) {
sourceSplits.add(pendingPartitionsQueue.poll());
}
sourceSplits.forEach(
Expand Down Expand Up @@ -166,7 +166,7 @@ record ->
// just for bounded mode
sourceSplit.setEndOffset(lastOffset);
}
} catch (Exception e) {
} catch (Throwable e) {
completableFuture.completeExceptionally(e);
}
completableFuture.complete(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,8 @@ public void pollNext(Collector<SeaTunnelRow> collector) throws Exception {
sourceSplit.setStartCursor(
response.getNextCursor());
completableFuture.complete(true);
} catch (LogException e) {
e.printStackTrace();
completableFuture.completeExceptionally(e);
throw new RuntimeException(e);
} catch (IOException e) {
e.printStackTrace();
} catch (Throwable e) {
log.error("pull logs failed", e);
completableFuture.completeExceptionally(e);
throw new RuntimeException(e);
}
Expand All @@ -141,11 +137,7 @@ public void pollNext(Collector<SeaTunnelRow> collector) throws Exception {
if (completableFuture.get()) {
finishedSplits.add(sourceSplit);
}
} catch (InterruptedException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
});
Expand Down Expand Up @@ -215,7 +207,6 @@ public void notifyCheckpointComplete(long checkpointId) throws Exception {
slsSourceSplit
.getStartCursor());
} catch (LogException e) {
e.printStackTrace();
log.error(
"LogException: commit cursor to sls failed",
e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void asyncStoreCheckPoint(PipelineState state) {
() -> {
try {
storeCheckPoint(state);
} catch (Exception e) {
} catch (Throwable e) {
log.error(
String.format(
"store checkpoint failed, job id : %s, pipeline id : %d",
Expand Down
Loading