EricJoy2048 commented on code in PR #4047:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4047#discussion_r1099631264


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:
##########
@@ -340,23 +338,22 @@ public PassiveCompletableFuture<Void> submitJob(long 
jobId, Data jobImmutableInf
             try {
                 runningJobInfoIMap.put(jobId, new 
JobInfo(System.currentTimeMillis(), jobImmutableInformation));
                 runningJobMasterMap.put(jobId, jobMaster);
-                
jobMaster.init(runningJobInfoIMap.get(jobId).getInitializationTimestamp());
-                jobMaster.initCheckPointManager();
+                
jobMaster.init(runningJobInfoIMap.get(jobId).getInitializationTimestamp(), 
false);
+                // We specify that when init is complete, the submitJob is 
complete
+                jobSubmitFuture.complete(null);
             } catch (Throwable e) {
                 logger.severe(String.format("submit job %s error %s ", jobId, 
ExceptionUtils.getMessage(e)));
-                voidCompletableFuture.completeExceptionally(e);
-            } finally {
-                // We specify that when init is complete, the submitJob is 
complete
-                voidCompletableFuture.complete(null);
+                jobSubmitFuture.completeExceptionally(e);
             }
-
-            try {
-                jobMaster.run();
-            } finally {
-                onJobDone(jobMaster, jobId);
+            if (!jobSubmitFuture.isCompletedExceptionally()) {
+                try {
+                    jobMaster.run();
+                } finally {
+                    onJobDone(jobMaster, jobId);

Review Comment:
   `onJobDone()` will not be call when 
`jobSubmitFuture.isCompletedExceptionally() == true`. I think we need remove 
the job from `runningJobInfoIMap` when the job submit 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to