zhangshenghang commented on code in PR #10075:
URL: https://github.com/apache/seatunnel/pull/10075#discussion_r2587226664


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java:
##########
@@ -220,10 +220,45 @@ public void savepointJob() {
         updateJobState(JobStatus.DOING_SAVEPOINT);
     }
 
+    public void stopJob() {
+        JobStatus jobStatus = getJobStatus();
+        if (jobStatus.isEndState()) {
+            log.warn("{} is in end state {}, can not be stop", jobFullName, 
jobStatus);
+            return;
+        }
+
+        if (jobStatus.ordinal() <= JobStatus.PENDING.ordinal()) {
+            // Tasks with the status 'INITIALIZING', 'CREATED', 'PENDING' need 
to be set directly to
+            // the 'CANCELLED' state because it has not yet started running
+            updateJobState(JobStatus.CANCELED);
+        } else if (jobStatus == JobStatus.DOING_SAVEPOINT) {
+            
this.pipelineList.forEach(SubPlan::finishPipelineIfCheckpointCompleted);

Review Comment:
   Here, I found that it tries to complete elegantly, but this approach may 
result in the inability to force stop abnormal tasks. Forcibly stopping a job 
should be destructive because it is only used when the job is in an abnormal 
state.
   
   We can remind users in the documentation that forcibly stopping a job may 
cause dirty data in the checkpoint.



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