Skip to content

Commit 35ac0d6

Browse files
committed
fix detail task may failed by log file expired
1 parent 0785222 commit 35ac0d6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/odc-service/src/main/java/com/oceanbase/odc/service/flow/FlowTaskInstanceService.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,10 @@ private void setDownloadUrlsIfNecessary(Long taskId, List<? extends FlowTaskResu
783783
return;
784784
}
785785
for (FlowTaskResult result : results) {
786-
TaskDownloadUrls urls = databaseChangeOssUrlCache.get(taskId);
786+
TaskDownloadUrls urls = getTaskDownloadUrls(taskId);
787+
if (urls == null) {
788+
return;
789+
}
787790
if (result instanceof AbstractFlowTaskResult) {
788791
((AbstractFlowTaskResult) result)
789792
.setFullLogDownloadUrl(urls.getLogDownloadUrl());
@@ -798,4 +801,13 @@ private void setDownloadUrlsIfNecessary(Long taskId, List<? extends FlowTaskResu
798801
}
799802
}
800803

804+
private TaskDownloadUrls getTaskDownloadUrls(Long taskId) {
805+
try {
806+
return databaseChangeOssUrlCache.get(taskId);
807+
} catch (Exception e) {
808+
log.warn("Failed to retrieve task download urls from cloud object storage, taskId={}", taskId, e);
809+
return null;
810+
}
811+
}
812+
801813
}

0 commit comments

Comments
 (0)