zhangshenghang commented on code in PR #10075:
URL: https://github.com/apache/seatunnel/pull/10075#discussion_r2661022887
##########
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);
Review Comment:
@dybyte There will be a problem here. When in the PENDING state, executing
`updateJobState(JobStatus.CANCELED);` leads to `stateProcess()`. At this time,
`isRunning = false` will directly cause a `return` in `stateProcess()`, which
will result in a resource leak. cc @corgy-w
--
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]