dybyte commented on code in PR #10692:
URL: https://github.com/apache/seatunnel/pull/10692#discussion_r3026573191


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:
##########
@@ -721,6 +721,16 @@ private void restoreJobFromMasterActiveSwitch(@NonNull 
Long jobId, @NonNull JobI
             return;
         }
 
+        if (jobState instanceof JobStatus && ((JobStatus) 
jobState).isEndState()) {
+            logger.warning(
+                    String.format(
+                            "Job %s is in terminal state %s in 
runningJobInfoIMap, "
+                                    + "removing zombie entry to prevent 
incorrect restore",
+                            jobId, jobState));
+            runningJobInfoIMap.remove(jobId);
+            return;
+        }

Review Comment:
   Instead of directly removing the jobId from runningJobInfoIMap,
   would it make sense to create the JobMaster and call
   `jobMaster.neverNeedRestore()` to ensure proper cleanup in the terminal 
state?
   
   This might help avoid leaving any incomplete cleanup behind. What do you 
think?
   cc @zhangshenghang 



-- 
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