Skip to content

Commit

Permalink
[Bug] [Master] kill task when TaskInstance set TimeoutFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
pegasas committed Feb 1, 2024
1 parent 8974233 commit 56580ab
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,8 @@ public BaseTaskExecuteRunnableTimeoutOperator(TaskInstanceDao taskInstanceDao) {

@Override
public void operate(DefaultTaskExecuteRunnable taskExecuteRunnable) {
// Right now, if the task is running in worker, the timeout strategy will be handled at worker side.
// if the task is in master, the timeout strategy will be handled at master side.
// todo: we should unify this, the master only need to handle the timeout strategy. and send request to worker
// to kill the task, if the strategy is timeout_failed.
TaskInstance taskInstance = taskExecuteRunnable.getTaskInstance();
TaskTimeoutStrategy taskTimeoutStrategy = taskInstance.getTaskDefine().getTimeoutNotifyStrategy();
if (TaskTimeoutStrategy.FAILED != taskTimeoutStrategy
&& TaskTimeoutStrategy.WARNFAILED != taskTimeoutStrategy) {
log.warn("TaskInstance: {} timeout, the current timeout strategy is {}, will continue running",
taskInstance.getName(), taskTimeoutStrategy.name());
return;
}
try {
timeoutTaskInstanceInDB(taskInstance);
killRemoteTaskInstanceInThreadPool(taskInstance);
Expand Down

0 comments on commit 56580ab

Please sign in to comment.