Skip to content

Commit

Permalink
feat(core): kill created tasks earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu authored and tchiotludo committed May 18, 2023
1 parent 9bd52c4 commit b6b5b9b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public Executor process(Executor executor) {
try {
executor = this.handleRestart(executor);
executor = this.handleEnd(executor);
// if killing: move created tasks to killed as they are not already started
executor = this.handleCreatedKilling(executor);
// if all tasks are killed or terminated, set the execution to killed
executor = this.handleKilling(executor);

// killing, so no more nexts
Expand All @@ -78,7 +81,6 @@ public Executor process(Executor executor) {
executor = this.handleWorkerTask(executor);

// search for worker task result
executor = this.handleChildWorkerCreatedKilling(executor);
executor = this.handleChildWorkerTaskResult(executor);

// search for flow task
Expand Down Expand Up @@ -416,7 +418,7 @@ private Executor handlePausedDelay(Executor executor, List<WorkerTaskResult> wor
return executor.withWorkerTaskDelays(list, "handlePausedDelay");
}

private Executor handleChildWorkerCreatedKilling(Executor executor) throws InternalException {
private Executor handleCreatedKilling(Executor executor) throws InternalException {
if (executor.getExecution().getTaskRunList() == null || executor.getExecution().getState().getCurrent() != State.Type.KILLING) {
return executor;
}
Expand Down

0 comments on commit b6b5b9b

Please sign in to comment.