You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "TaoZex (via GitHub)" <gi...@apache.org> on 2023/07/19 02:48:39 UTC

[GitHub] [seatunnel] TaoZex commented on a diff in pull request #5114: [Feature][Zeta] Support history service record job execute error

TaoZex commented on code in PR #5114:
URL: https://github.com/apache/seatunnel/pull/5114#discussion_r1267480287


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:
##########
@@ -495,10 +495,11 @@ public PassiveCompletableFuture<Void> savePoint(long jobId) {
     public PassiveCompletableFuture<JobResult> waitForJobComplete(long jobId) {
         JobMaster runningJobMaster = runningJobMasterMap.get(jobId);
         if (runningJobMaster == null) {
-            JobStatus jobStatus = jobHistoryService.getJobDetailState(jobId).getJobStatus();
+            JobHistoryService.JobState jobState = jobHistoryService.getJobDetailState(jobId);
             CompletableFuture<JobResult> future = new CompletableFuture<>();
-            // TODO support history service record job execute error
-            future.complete(new JobResult(jobStatus, null));
+            if (jobState == null) future.complete(new JobResult(JobStatus.FAILED, null));

Review Comment:
   How about changing null (after JobStatus.FAILED) to alert that the job failed?



##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:
##########
@@ -495,10 +495,11 @@ public PassiveCompletableFuture<Void> savePoint(long jobId) {
     public PassiveCompletableFuture<JobResult> waitForJobComplete(long jobId) {
         JobMaster runningJobMaster = runningJobMasterMap.get(jobId);
         if (runningJobMaster == null) {
-            JobStatus jobStatus = jobHistoryService.getJobDetailState(jobId).getJobStatus();
+            JobHistoryService.JobState jobState = jobHistoryService.getJobDetailState(jobId);
             CompletableFuture<JobResult> future = new CompletableFuture<>();
-            // TODO support history service record job execute error
-            future.complete(new JobResult(jobStatus, null));
+            if (jobState == null) future.complete(new JobResult(JobStatus.FAILED, null));

Review Comment:
   How about changing null (after JobStatus.FAILED) to alert that the job failed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org